What simply happened here is that you first want everything in terms of sines and cosines without multiple arguments. Since $\cos\,3x=4\cos^3\,x-3\cos\,x$, making that substitution into your original equation yields $\sin^3 x+4\cos^3\,x-3\cos\,x=0$.
Now, morally this is an equation in a single variable. However, one could skip having to tangle with transcendentals if we let $c=\cos\,x$ and $\sin\,x$, yielding $s^3+4c^3-3c=0$. But in going to this form, we now have two variables to contend with. To undo the extra degree of freedom we added, we now add the additional equation $c^2+s^2=1$, which is from the Pythagorean formula. Now you have two equations in two unknowns...
An alternative is to consider the Weierstrass substitution. If we let $c=\dfrac{1-t^2}{1+t^2}$ and $s=\dfrac{t}{1+t^2}$, we again end up with a single equation in a single unknown, which can be solved by purely algebraic means. As soon as you obtain values of $t$, one can retrieve the corresponding $x$, since $x=\tan\dfrac{t}{2}$... (why?)