Group together the terms that have "like" variables or constants in them. The first 2 terms both have an x, but the second 2 don't, so the first two are grouped together. The second 2 terms, while they do not have a common variable, both have the number 2. So those are grouped together. (xa - xb) - (2a + 2b)--> x(a-b) - 2(a-b). Now you can actually factor out the like term (a-b) to get this: (a-b)(x-2).