If you know that holomorphic functions have Taylor series, then this is easy.
Expand $f$ in Taylor series around $z=a$.
Then the Taylor series for $\dfrac{f(z)}{(z-a)^2}$ has the term $\dfrac{f'(a)}{(z-a)}$ and all the other terms have primitives and so integrate to zero.
Therefore, we're left with a single term (hence the name residue):
$$
\int_{\gamma} \dfrac{f(z)}{(z-a)^2} dz
= \int_{\gamma} \dfrac{f'(a)}{(z-a)} dz
= 2 \pi i f'(a)
$$
The only technical point is that last integral. You can prove that it is the same as the integral around a small circle centered at $z=a$, which is easy to compute.
The same argument proves that
$$
\int_{\gamma} \dfrac{f(z)}{(z-a)^{k+1}} dz
= 2 \pi i f^{(k)}(a)
$$