I haven't done factoring in ages

I'm trying to factor this

X^2 - 2X + 8

If i remeber correctly sense the leading coefficent is 1 the factored form is in this format

(X-A)(X-B)
which would give you
X^2 -AX - Bx + AB
or simply
X^2 -(A+B)X +AB
so then in my problem

-(A+B)X = -2
AB = 8

So I don't know were to go from here

What is the real way to do this? Not the way they teach you in 8 grade with the table and the gaint X but the real mathematical way to do this? Not just guess and check in your head tell you find an answer but the real way a professional person would do this? Guessing and checking takes to long?

so please tell me the REAL way to do this not just guessing and checking. I also don't know the answer to this problem...

Thanks!!!

If the leading coefficient is 1, then what you describe is correct

that is,
you are looking for two numbers A and B so their product is the constant at the end, and their sum is the middle coefficient.
so we are looking for two numbers whose product is +8 and their sum is -2
(there are no such rational numbers)

Are you sure the last number wasn't -8 ?
Then the two numbers would have been -4 and +2
for (x-4)(x+2)

The way you typed it, there would be no factors with rational numbers.