The critical step here is to FACTOR, FACTOR, FACTOR, and FACTOR!!
You are NOT allowed to divide out terms such as or numbers that are involved in addition or subtractions. Everything must be in FACTORED form in order to reduce the fractions.
Now you can divide out the factors that are the same. You can divide out ANY factor of ANY numerator with ANY factor of ANY denominator. This is a good place for a "cartoon" by tutor and owner of this website Igor Chudov, but I haven't learned to do that yet. Maybe he will add a cartoon to this solution to show how the factors divide out. Until then, just divide out the factors of (x-7), (x-1), and (x-2). What is left is the (x+5) in the numerator, and the (x+4) in the denominator.