We have that
\begin{equation} dS_t=\mu S_t dt + \sigma S_t dW_t \end{equation}
Now apply Itô
$$ d\log S_t= \frac{\partial\log S_t}{\partial t} +\frac{\partial \log S_t}{\partial S_t} dS_t + \frac12 \frac{\partial^2 \log S_t}{\partial S_t^2}d\langle S_t,S_t\rangle $$
We have that $\frac{\partial\log S_t}{\partial t}=0$ because the function $f(S_t,t)=\log S_t$ doesn't directly depend on $t$. Moreover, since $\frac{d}{dx} \log x=\frac{1}{x}$ and $\frac{d^2}{dx^2} \log x=-\frac{1}{x^2}$, we obtain the following formula:
$$ d\log S_t= \frac{1}{S_t} dS_t -\frac12 \frac{1}{S_t^2}d\langle S_t,S_t\rangle $$
Just use the fact that the quadratic variation of $S_t$ is simply $\langle S_t,S_t\rangle =\sigma^2 S_t^2$ and the first equation to obtain:
$$d \log S_t = \left(\mu -\frac{\sigma^2}{2}\right) dt +\sigma dW_t $$
Integrate and obtain
$$\log S_t = \log S_0 + (\mu-\frac12 \sigma^2)t +\sigma W_t$$
If you apply Itô's lemma you get back to the previous point.
If you use the exponential you finally have your result:
$$S_t=S_0 e^{(\mu-\frac12 \sigma^2)t +\sigma W_t}$$
Tadaaa