Your first term, upon division: $x^2$ is correct $\large\checkmark$ (in the quotient), leaving
$$ x - 2 | -x^2 - 4x + 12\quad\large\checkmark$$
I know that the leading term goes into the inner leading term $-x$ times or however you say that.
$$ x - 2 | - 2x + 12 \quad \longleftarrow \text{error}$$
Here you subtracted incorrectly: We should have $x^2 - x$ in the quotient, that's correct, but multiplying $-x(x - 2) = -x^2 + 2x$
So when we subtract, we subtract, from $(-x^2 - 4x + 12) - (-x^2 + 2x) = -6x + 12$.
Now, we have $$ x -2 \mid -6x + 12$$ and so our ongoing quotient becomes $x^2 - x {\bf - 6}$
which, leaves a zero remainder since $-6(x-2) = -6x + 12$, as desired.
So...we have that $$\frac{x^3 - 3x^2 -4x + 12}{x - 2} = x^2 - x - 6$$
Or, that is, $$x^3 - 3x^2 - 4x + 12 = (x -2)(x^2 - x - 6) = (x-2)(x +2)(x - 3)$$
Best Answer
As said, "it works the same way as euclidean division works for integers" (quoting Bernard). So, if you take $$A=\dfrac{3x^3 - 2x^2 + 4x - 3 } {x^2 + 3x + 3}$$ The division of $3x^3$ by $x^2$ (the highest terms) gives $3x$. So $$A=3x+\Big(\dfrac{3x^3 - 2x^2 + 4x - 3 } {x^2 + 3x + 3}-3x\Big)=3x -\frac{11 x^2+5x+3}{x^2 + 3x + 3}=3x-B$$ Now, consider $$B=\frac{11 x^2+5x+3}{x^2 + 3x + 3}$$ The division of $11x^2$ by $x^2$ (the highest terms) gives $11$. So $$B=\frac{11 x^2+5x+3}{x^2 + 3x + 3}=11+\Big(\frac{11 x^2+5x+3}{x^2 + 3x + 3}-11\Big)=11-\frac{28 x+30}{x^2 + 3x + 3}=11-C$$ Now, the highest degree in the numerator of $C$ is smaller that the highest degree in its denominator so you stop and have the remainder. So, by the end $$A=\dfrac{3x^3 - 2x^2 + 4x - 3 } {x^2 + 3x + 3}=3x-11-\frac{28 x+30}{x^2 + 3x + 3}$$