I took this from Da Carmo (page 344), not that is matters. I am going to use his curves and surface formula just to ensure the answer doesn't require any geometry answerers as I really feel this is analysis. If you would like he has the same proof in his Riemannian geometry book on page 196.
A regular parametrized curve by arc length (so it is a geodesic?) $\alpha:[0,\ell] \to S$ is a geodesic $\iff$ for every proper variation $h: [0,\ell] \times (-\epsilon, \epsilon) \to S$ of $\alpha$, $L'(0) = 0$
Here $L'(0) = -\int_0^\ell \left < A(s),V(s) \right > ds$ with $V(s) = \partial h/\partial t (s,0)$ and $A(s) = (D/\partial s) \partial h/\partial s (s,0).$
Note that $L'(0)$ is the derivative of the energy function.
Okay my question lies in $\leftarrow$. Basically he says suppose $L'(0) = 0$, then we consider the variational field $V(s) = g(s)A(s)$. Why? I thought $V$ is supposed to be generic, why would we consider only forms of $V$ like that?

You want to prove that if for any proper variation $L'=0$ then the curve is a geodesic. Then, you can choose any particular variation and, if that suffices to prove that the curve is a geodesic, you are done.
A similar example: a sequence converges to $L$ iff all of its subsequences converge to $L$. Proof from right to left: Take the sequence itself.