Assuming:

Notice that in the numerator, there are two terms:

and

that subtract from each other. We need to find common factors in both sides of the subtraction that we can "pull out". Let's look at the factors in the numerator like this:

Then we have this:

You should be familiar enough with extracting common factors to know that this is:

Now we know that our factors are a & b, which means in the original you can extract and from both terms. You might be able to see how one of these factors will cancel out with a factor in the denominator, too. If this is still confusing, I suggest you try more simple factoring exercises.