There are two definitions of a vector field on a smooth manifold $M$.
A smooth map $V:M \rightarrow TM, \forall p \in M:V(p) \in T_p M$.
A linear map $V:C^{\infty}(M) \rightarrow C^{\infty}(M), \forall f,g:V(fg)=fV(g)+gV(f)$
I can't undestand why they are equivalent. We must somehow build $2$ maps and show that their composition is $id$, but i don't have any ideas how. Please help.
This depends heavily on your definition of the tangent space $T_{p}M$, and thus the tangent bundle $TM$. There are several equivalent ways of defining it. Which book are you following?
If your definition of the tangent space $T_{p}M$ is a vector space of linear maps $V : C^{\infty}(p)\to\mathbb{R}$ that satisfy the Leibniz rule, i.e. $$V(fg)=f(p)V(g)+g(p)V(f),$$ where $C^{\infty}(p)$ is defined as \begin{align*} C^{\infty}(p)=\{f:U\to\mathbb{R}\,\,|\,\,f\,\,\mathrm{is}\,\,\mathrm{smooth}\,\,\mathrm{at}\,\,p\in U\,\,\mathrm{and}\,\,U\subseteq M\,\,\mathrm{is}\,\,\mathrm{open}\}, \end{align*} as is usually done, then this exercise is pretty straight forward.
Get a map $\Psi:(1)\to (2)$ as follows. For each $V$ satisfying $(1)$ assign a linear map $\Psi(V)$ satisfying $(2)$ by taking $\Psi(V)(f)(p)=V(p)(f)$ for all $f\in C^{\infty}(p)$ and $p\in M$. Show that this is one-to-one and onto, or alternatively define an inverse $\Phi:(2)\to (1)$ by assigning for each $V$ satisfying $(2)$ a smooth map $\Phi(V)$ satisfying $(1)$ by taking $\Phi(V)(p)(f)=V(f)(p)$ for all $p\in M$ and $f\in C^{\infty}(p)$. So you get that the two definitions are equivalent.