I'm going to assume everything is happening in $\mathbb{R}^n$, which I think is what you intended.

Start by defining V(0) = 0.

Now, for each $x\in \mathbb{R}^n$, let $\gamma_x:[0,b]\rightarrow \mathbb{R}^n$ be a (piecewise) smooth curve with $\gamma_x(0) = 0$ and $\gamma_x(b) = x$, i.e., $\gamma_x$ is any continuous curve joining $0$ to $x$. Define $V(x) = \int_0^b W \cdot d\gamma_x(t) = \int_0^b W(\gamma_x(t))\cdot \gamma_x'dt$, that is, $V(x)$ is the result obtained by integrating $W$ along $\gamma_x$.

First note that by the fundamental theorem for line integrals, $V(x)$ is independent of the choice of curve. Thus, to actually compute $V(x)$, one may as well take $\gamma_x$ to be a straight line joining $0$ and $x$ (or, if some other path gives a nicer integral, use that).

However, to actually prove that this $V(x)$ satisfies $\nabla V = W$, it'll help to be able to pick the curves however we want.

So, why does this $V(x)$ work? Well, suppose one wants to compute $\frac{d}{dx_1} V(x)$. Formally, this is lim$_{h\rightarrow 0} \frac{V(x+he_1) - V(x)}{h}$, where $e_1$ is a unit vector in the direction of $x_1$.

To actually evaluate this, make life as easy as possible by picking $\gamma_{x+he_1}$ and $\gamma_x$ nicely. So, pick $\gamma(t)$ to be a smooth curve which starts at 0, and when , near $x$, looks like a straight line pointing in the direction of $e_1$, with $\gamma(1) = x$. Thus, $\gamma(t)$ is both $\gamma_x$ and $\gamma_{x+he_1}$, if you travel along it long enough.

Then $V(x+he_1) - V(x) = \int_1^{1+h} W\cdot e_1 dt$.

But then $\frac{d}{dx_1} V(x) = $lim$_{h\rightarrow 0}\frac{1}{h} \int_1^{1+h} W\cdot e_1 dt$. But then, by the fundamental theorem of calculus (the usual one variable version), this is exactly $W\cdot e_1$, i.e., it's the first component of $W$. Of course, the other components work analogously.

(Incidentally, using Petya's isomorphism between vector fields and one forms, and using Stokes' theorem in place of the fundamental theorem of line integrals, this proves that $H^1_{\text{de Rham}}(\mathbb{R}^n) = 0$)