Integrate: $\int_0^\infty \frac{\sin^2(x)}{x^2}dx$

What you try to do won't work since your function is (almost) analytic insde the path you take and thus won't help you to evaluate the real integral.

Let us try the following:

$$\cos 2x=1-2\sin^2x\implies \sin^2x=\frac{1-\cos2x}{2} \;\text{define}\;\;f(z):=\frac{1-e^{2iz}}{2z^2}:$$

$$\text{Res}_{z=0}(f)=\lim_{z\to 0}\,zf(z)=\lim_{z\to 0}\frac{1-e^{2iz}}{2z}\stackrel{\text{l'Hospital}}=-i$$

Question: The above implies $\,z=0\,$ is a simple pole...why is this so and not a double one?

Taking your contour, taking the limits and etc. and using the lemma and, specially, its corollary in the 2nd. answer here , we get after comparing real and imaginary parts

$$\int\limits_{-\infty}^\infty\frac{\sin^2x}{x^2}dx=\pi\;\;\ldots\ldots$$