There are a couple of ways to attack this, but I will choose my way.
Let's rewrite the expression as:
(x^3 - 8)/(x - 2) + 1/(x - 2)
This is equal to our original expression.
When factoring a difference of two cubes you get this:
a^3 - b^3 = (a - b)(a^2 + ab + b^2)
x^3 - 8 = (x - 2)(x^2 +2x + 4)
Now we have:
(x - 2)(x^2 + 2x + 4)/(x - 2) + 1/(x - 2)
You can cancel out the x-2 term in the numerator & denominator. You get:
x^2 + 2x + 4 + 1/(x-2)