Do not know what you have been taught. For instance, one may see that x = -3 works:
-27+9+18=0.
Once you know one solution, you can use synthetic division or other methods.
For instance, this may confuse you :(,
(x+3)*(x^2 + a*x + b ) = x^3+x^2+18,
so a + 3 = 1, and 3*b = 18. Then a=-2 and b = 6:
(x+3)(x^2-2x+6) = x^3-2x^2+6x + 3x^2-6x+18 = x^3+x^2+18, good!
Then the roots of x^2-2x+6 can be found with the quadratic formula:
x = ( 2 +/- sqrt( 4 -24 ) )/ 2, ups complex!!
So only x= -3 is a root!
Hope it helps