Okay, so lets do this!
(3x^2y - 5xy + 12xy^2) - (5xy^2 + 4xy)
Simplify the sum and then order the factors of 3x^2y.
Now order factors for -5xy to get (3yx^2 + 12xy^2 - 5yx) - (5xy^2 + 4yx)
Order the factors for 4xy to get 3yx^2 +12xy^2 - 5yx + -5xy^2 - 4yx
Reorder the terms:
3yx^2 + 12xy^2 - 5xy^2 - 5yx - 4yx. Our answer.