Counting the Number of Real Roots of $y^{3}-3y+1$
The given polynomial evaluated at $y\in\{-2,0,1,2\}$ exhibits three sign changes, hence it has at least $3$ real roots, and obviously cannot have more than three roots.
The function has extrema where
$$3y^2-3=0$$ i.e. at $y=\pm1$. The values at these extrema are $3$ and $-1$.
So the variations of this continuous function are $-\infty,3,-1,\infty$, proving that there are three changes of sign.
For a cubic polynomial, the search for the extrema may be more efficient than trial-and-error because it is immediately conclusive.
In the case of a depleted polynomial $$x^3+px+q$$
the extrema are located at $$x=\pm\sqrt{-\frac p3}$$ if $p<0$.
In this case there are three real roots if
$$\sqrt{-\frac p3}^3-p\sqrt{-\frac p3}+q>0\text{ and }-\sqrt{-\frac p3}^3+p\sqrt{-\frac p3}+q<0,$$ or
$$\frac{2p}3\sqrt{-\frac p3}<-|q|.$$
Let $f(y) = y^3 - 3y + 1$. Then you can observe that $f(0) = 1, f(1) = -1$; thus $f$ has at least one root between $0$ and $1$, by the intermediate value theorem. You can find the other two roots similarly.