I can do:
x^2-7x+10
But I can't do:
2x^2-7x-15.
$\displaystyle 2x^2-7x-15 = (2x+3)(x-5)$
Factoring Quadratics: The Hard Case
When you said that you can factor $\displaystyle x^2-7x+10$ 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 $\displaystyle x^2$ and the constant term.
For $\displaystyle 2x^2-7x-15$ 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: $\displaystyle 2x^2-10x+3x-15$ and factor this by grouping the first two term and the last two terms.
$\displaystyle (2x^2-10x)+(3x-15)=2x(x-5)+3(x-5)=(2x+3)(x-5)$
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.