When you said that you can factor I am assuming you tried to find two numbers which multiply to give you 10 (the constant term) and which add up to -7 (the coefficient of the middle term). The numbers are -5 and -2 so the factors are (x-5)(x-2).
The master product method may help you to factor problems like the one you asked about.
To get the master product, multiply the coefficient of and the constant term.
For the master product is (2)(-15) = -30.
Try to find 2 numbers which multiply to give you -30 (the master product) and which add up to -7 (the coefficient of the middle term). The numbers are -10 and 3.
Rewrite the middle term of the problem as -10x + 3x: and factor this by grouping the first two term and the last two terms.
Happy Factoring!
You could try to memorize some rule for how to do these, but I wouldn't recommend it. I think your time would be better invested in actually working 10 -20 such problems. Doing examples is how you learn to "guess well" and "kinda see" what's going on. Work the problems via trial and error, thinking about why things do or don't work - and you'll find your guesses and understanding improving quickly.
If you want to learn to play the piano, at some point you've got to suffer to bang on the keys.