Never understood 'foil', myself. However, there's another fairly good way to do it.
Take 4X2-8x+4, for example. There are only four ways to get a positive 4, and that's 1*4, 2*2, -1*-4, and -2*-2. To get X2, you need two X's. So here's what you know it has to start with:
(X+?)*(4X+?)
or
(-X+?)*(-4X+?)
or
(2X+?)*(2X+?)
or
(-2X+?)*(-2X+?)
Because the highest power is a square, that means the highest power in the factors will be 1. Anything after that is an integer. (Technically speaking, it could be any number, but they don't usually use irrational numbers and fractions to teach this stuff.) At this point, you take a good look at the integer in the original function.
In this case, it's a 4. As before, there are only a few ways to get that. 1*4, 2*2, and the negatives of those.
(2x+1)*(2x+4) - Multiply the 2x's and you get 4x2. So far so good. Now, multiply the integers. +4. Also good. But now you multiply each 2x by the opposite integer, and add those together. That's 10x. Not so good. You'll need a negative number.
(-2x+1)*(-2x+4) - Once more you get 4x2, and the integers multiply to +4. The x's, on the other hand, amount to -8+-1, which is just -10. Closer, but not close enough.
(-4x+1)*(-x+4) - This time, you get 4x2 and 4 and usual. But add the multiplied-out x's, and they sum to -16x+-1, which is -17. That's even further away. So switch some numbers around!
(-4x+4)*(-x+1) - 4x2+4 as usual, but the middle term (the x result) must be calculated. Now you get -4x+-4x. That's -8x, and you've solved the problem.
There are other shortcuts, but eventually you'll pick up on it. Factoring is something that you have to do all the way through calculus. (Though admittedly it gets a lot easier once you can integrate and derive functions.)