Factor out the common terms in the first two terms, then in the last two terms
x(y - 5) + 2(y - 5)
Factor out the common term y - 5
(y - 5)(x + 2)