$$S_t=S_0\exp\bigg(\bigg(\mu-\frac{\sigma^2}{2}\bigg)t+\sigma W_t\bigg).$$
What I tried to do is applying Ito's formula to above equation to derive SDE.
If I define $g = S_t$ then,
$dg = g_t*dt+g_{W_t}*dW_t+\frac{1}{2}g_{tt}(dt)^2+\frac{1}{2}g_{W_tW_t}(dW_t)^2+\frac{1}{2}g_{tW_t}(dtdW_t)$
And the solution of $g_t$ is $(μ-\frac{1}{2}σ^2)*g$
But I think $W_t$ is dependent on time, so the solution is wrong because it just deals $W_t$ independently with $t$
Above solution totally makes $W_t$ constant on time
Why $g_t = (μ-\frac{1}{2}σ^2)*g$ ??
You need to disentangle the notation. In SDE one often uses the old notation dating back to the times of Leibniz where the argument is in the subscript. So $S_t$ is $S$ at time $t$, or $S_t(\omega)=S(t,\omega)$.
Next you used subscripts for partial derivatives. In using both, it is customary to put a separation sign before the derivative subscripts. So if $g(x)=x$, the $g_{,x}(S_t)=1$. But that is probably not what you wanted. If you meant $$ g(t,x)=S_0\exp((μ−\tfrac12σ^2)t+σx), $$ then the Ito formula gives for $S_t=g(t,W_t)$ $$ dS_t=(g_{,t}(t,W_t)+\tfrac12g_{,xx}(t,W_t))\,dt+g_{,x}(t,W_t)\,dW_t \\ =[(μ−\tfrac12σ^2)+\tfrac12σ^2]S_t\,dt+σS_t\,dW_t. $$