The roots of polynomial $ p(x) $ are:
$$ \begin{aligned}x_1 &= 3\\[1 em]x_2 &= -1\\[1 em]x_3 &= -2 \end{aligned} $$Step 1:
Combine like terms:
$$ x^3 \color{blue}{-6x} \color{blue}{-x} -6 = x^3 \color{blue}{-7x} -6 $$Step 2:
Use rational root test to find out that the $ \color{blue}{ x = 3 } $ is a root of polynomial $ x^3-7x-6 $.
The Rational Root Theorem tells us that if the polynomial has a rational zero then it must be a fraction $ \dfrac{ \color{blue}{p}}{ \color{red}{q} } $, where $ p $ is a factor of the constant term and $ q $ is a factor of the leading coefficient.
The constant term is $ \color{blue}{ 6 } $, with a single factor of 1, 2, 3 and 6.
The leading coefficient is $ \color{red}{ 1 }$, with a single factor of 1.
The POSSIBLE zeroes are:
$$ \begin{aligned} \dfrac{\color{blue}{p}}{\color{red}{q}} = & \dfrac{ \text{ factors of 6 }}{\text{ factors of 1 }} = \pm \dfrac{\text{ ( 1, 2, 3, 6 ) }}{\text{ ( 1 ) }} = \\[1 em] = & \pm \frac{ 1}{ 1} \pm \frac{ 2}{ 1} \pm \frac{ 3}{ 1} \pm \frac{ 6}{ 1} ~~ \end{aligned} $$Substitute the possible roots one by one into the polynomial to find the actual roots. Start first with the whole numbers.
We can see that $ p\left( 3 \right) = 0 $ so $ x = 3 $ is a root of a polynomial $ p(x) $.
To find remaining zeros we use Factor Theorem. This theorem states that if $ \dfrac{p}{q} $ is root of the polynomial then the polynomial can be divided by $ \color{blue}{qx − p} $. In this example we divide polynomial $ p $ by $ \color{blue}{ x-3 }$
$$ \frac{ x^3-7x-6}{ x-3} = x^2+3x+2 $$Step 3:
The next rational root is $ x = 3 $
$$ \frac{ x^3-7x-6}{ x-3} = x^2+3x+2 $$Step 4:
The next rational root is $ x = -1 $
$$ \frac{ x^2+3x+2}{ x+1} = x+2 $$Step 5:
To find the last zero, solve equation $ x+2 = 0 $
$$ \begin{aligned} x+2 & = 0 \\[1 em] x & = -2 \end{aligned} $$