Evaluating Contour Integral of square Evaluating $\frac{1}{2i\pi} \oint_C \frac{z^2}{z^2+4} dz$ where $C$ is the square with vertices at $\pm 2$ and $\pm 2 + 4i$
So, I rewrote the contour integral:$\frac{1}{2i\pi} \oint_C \frac{z^2}{(z+2i)(z-2i)} dz$
then used the Cauchy Integral Theorem:
$\frac{1}{2i\pi} \oint_C \frac{z^2}{(z+2i)(z-2i)} dz$ = $\frac{1}{2i\pi} \oint_C \frac{\frac{z^2}{z+2i}}{z-2i} dz$ + $\frac{1}{2i\pi} \oint_C \frac{\frac{z^2}{z-2i}}{z+2i} dz$ and my answer for the two contour integrals is $0$.
Is it done correctly or I did incorrectly.

You have done the integration incorrectly; the answer is $i$ (backed up by numerical evaluation using mpmath).
The contour encircles a simple pole of the integrand at $2i$. By Cauchy's integral formula applied to $f(z)=\frac {z^2}{z+2i}$
$$f(2i)=i=\frac1{2\pi i}\oint_C\frac{f(z)}{z-2i}\,dz=\frac1{2\pi i}\oint_C\frac{z^2}{z^2+4}\,dz$$
