There are some patterns that you see so often in math, that you are expected to recognize them.
So, when you see (x+n)(x+m) the product is x2 + (n+m)x + n*m
And, when factoring, you might simply think of two numbers that add to B and multiply to give C in
Ax2 + Bx + C = 0
Well, look at the equation. A=1 C=n*m What is the value of B?