I have no idea how to explain it so you would understand it, but just know that you need to have factors of the third number (40(with no variables)) be equal to the second number (-14x(Which only has a variable (not squared)))
Therefore a factor would be -10 and -4, since -10*-4=40 and -10+(-4)= -14
With these two numbers you can set it up so that it's like this;
(x-10)(x-4)
Having this, you now have 2 equations;
x-10 = 0
and
x-4=0 (Don't ask why)
So now you solve for x, making it 10 or 4