First we split $\sin^2(x)=\frac{(1-e^{2ix})+(1-e^{-2ix})}{4}$. To avoid the pole at $x=0$, drop the path of integration a bit below the real line (this function has no poles and it vanishes at infinity, so this is okay).
Next, let $\gamma^+$ be the path below the real axis, then circling back in a semi-circular path counterclockwise around the upper half-plane; and let $\gamma^-$ be the path below the real axis, then circling back in a semi-circular path clockwise around the lower half-plane.
$\hspace{4cm}$
Note that $\gamma^+$ circles the pole at $x=0$ of $\frac{(1-e^{2ix})}{4x^2}$ and $\gamma^-$ misses the pole at $x=0$ of $\frac{(1-e^{-2ix})}{4x^2}$.
Therefore,
$$
\begin{align}
\int_{-\infty}^\infty\frac{\sin^2(x)}{x^2}\mathrm{d}x
&=\int_{-\infty-i}^{\infty-i}\frac{1-\cos(2x)}{2x^2}\mathrm{d}x\\
&=\int_{-\infty-i}^{\infty-i}\frac{(1-e^{2ix})+(1-e^{-2ix})}{4x^2}\mathrm{d}x\\
&=\color{green}{\int_{\gamma^+}\frac{(1-e^{2ix})}{4x^2}\mathrm{d}x}+\color{red}{\int_{\gamma^-}\frac{(1-e^{-2ix})}{4x^2}\mathrm{d}x}\\
&=\color{green}{2\pi i\frac{-2i}{4}}+\color{red}{0}\\
&=\pi
\end{align}
$$