This is the difference of two cubes. It is similar to a difference of two squares in that there is a formula for factoring it.
This is the formula
(a^{3} - b^{3}) = (a^{2} +ab + b^{2})
In this case a = x since (x)^{3} = x^{3 }and b = 2, since 2^{3} = 8.
So plug in x for a, and 2 for b into the following:
(a^{3} - b^{3}) = (a^{2} +ab + b^{2})
Giving you:
(x^{3} - 8) = (x-2)(x^{2} + (x)(2) + 2^{2}) = (x-2)(x^{2} + 2x + 4)
Check
x(x^{2} +2x + 4) - 2(x^{2} + 2x + 4)
x^{3} +2x^{2} +4x -2x^{2}
-4x - 8
The x^{2} terms and the x terms cancel out and you are left with:
x^{3} - 8
Note that if it had been x^{3} + 8, the factors would be (x+2)(x^{2}-2x+4)