Try to "guess" some rational root $\;\cfrac rs\;$ , which by the Rational Root Theorem must fulfill $\;r\,\mid\,-2\;,\;\;s\,\mid\,1\;$ , and indeed $\;2\;$ is a root, so divide by $\;x-2\;$ :
$$x^3-3x-2=(x-2)(x^2+2x+1)=(x-2)(x+1)^2$$
and you have one simple root and one double one.
If there is no rational root then the task is much, but really much harder _in the general case_