Roughly, let $f :(t,x) \rightarrow f(t,x)$ from $\mathbb{R^2}$ to $\mathbb{R}$, a function smooth enough, classic differentiation gives $$\Delta f(t,x)=\frac{\partial f}{\partial t}\Delta t+\frac{\partial f}{\partial x}\Delta x+\frac{1}{2}\frac{\partial^2 f}{\partial x^2}\Delta x^2+\frac{1}{2}\frac{\partial^2 f}{\partial t^2}\Delta t^2+\mathcal{O(\Delta x^2)}+\mathcal{O(\Delta t^2)}$$
Using infinitesimal $\Delta x$ and $\Delta t$, second order terms vanish, and we write
$$d f(t,x)=\frac{\partial f}{\partial t}d t+\frac{\partial f}{\partial x}d x$$
However, if $x$ refers now to a Brownian motion , moving to infinitesimal $\Delta x$ and $\Delta t$, $\Delta t^2$ still vanishes, but $\Delta x^2$ becomes $\Delta t$ because of the non-nil quadratic variation of the Brownian motion. That is why you may hear that a Brownian motion is in terms of $\sqrt{t}$.
Henceforth, the formula differs from the classic one as $\Delta x^2$ is not negligeable anymore , and we have
$$d f(t,x)=\frac{\partial f}{\partial t}d t+\frac{\partial f}{\partial x}d x+\frac{1}{2}\frac{\partial^2 f}{\partial x^2}dx^2$$
This is the Ito-formula, and $x$ can be any Ito-process, a Brownian motion being one of them.
Now regarding your exercise :
Let $W$ a Brownian motion , and $f(t,x)=x^2$. You would agree that $W$ is a Brownian motion, hence an Ito process. Furthermore $f$ is twice differentiable.
You can apply the Ito's lemma, and use that $\frac{\partial f}{\partial t}=0$, $\frac{\partial f}{\partial x}=2x$ and $\frac{\partial^2 f}{\partial x^2}=2$.
Here $x$ refers to the Brownian motion $W$
Thus,
$$d f(t,W_t)=0d t+2W_td W_t+\frac{1}{2}2dW_t^2$$
I stated before that the quadratic variation of $W$ gives that $dW_t^2=dt$. We have
$$d f(t,W_t)= 2W_td W_t+dt$$
By integration the equation , we have
$$f(T,W_T)-f(0,W_0)=2\int_{0}^{T}{W_tdW_t}+T$$
or
$$ W_T^2=2\int_{0}^{T}{W_tdW_t}+T$$
Finally, by switching the term in $T$ and dividing by $2$, we have what you want .