We assume that $a$ and $b$ are real-valued and positive-valued parameters.
Let $z=e^{it}$ so that $\cos t = \frac12(z+z^{-1})$, $\sin t=\frac1{2i}(z-z^{-1})$, $dt=dz/iz$ and $t$ goes from $0$ to $2\pi$. Then,
$$\begin{align}
\int_0^{2\pi} \frac{dt}{a^2\cos^2 t+b^2\sin^2t}&=\oint_C \frac{1}{a^2\frac14(z+z^{-1})^2-b^2\frac14(z-z^{-1})^2}\frac{dz}{iz}\\\\
&=-\frac{4i}{a^2-b^2}\oint_C\frac{zdz}{z^4+2\frac{a^2+b^2}{a^2-b^2}+1}
\end{align}$$
where $C$ is the unit circle. Roots of the denominator are at $\pm i \sqrt{\frac{a-b}{a+b}}$ and $\pm i \sqrt{\frac{a+b}{a-b}}$. For $a>b$, the roots inside the unit circle are $\pm i \sqrt{\frac{a-b}{a+b}}$. The residues of the integrand are easy to compute and both are given by
$$\frac12\frac{a^2-b^2}{4ab}.$$
Thus, we have that
$$\begin{align}
\int_0^{2\pi} \frac{dt}{a^2\cos^2 t+b^2\sin^2t}&=-\frac{4i}{a^2-b^2}2\pi i\sum \text{Res}\left(\frac{z}{z^4+2\frac{a^2+b^2}{a^2-b^2}+1}\right)\\\\
&=-\frac{4i}{a^2-b^2}2\pi i\left(2\frac12\frac{a^2-b^2}{4ab}\right)\\\\
&=\frac{2\pi}{ab}
\end{align}$$
as was to be shown. If $b>a$, symmetry considerations show that the value of the integral is unchanged.
NOTE:
This integral can be evaluated without appeal to contour integration. We see that
$$\begin{align}
\int_0^{2\pi} \frac{dt}{a^2\cos^2 t+b^2\sin^2t}&=\frac{4}{a^2}\int_0^{\pi/2}\frac{\sec^2 t}{1+\frac{b^2}{a^2}\tan^2 t}\,dt\\\\
&=\frac{4}{ab}\int_0^{\infty}\frac{du}{1+u^2}\\\\
&=\frac{4}{ab}\frac{\pi}{2}\\\\
&=\frac{2\pi}{ab}
\end{align}$$
as expected!!
NOTE 2:
If one chooses to parameterize with an ellipse, then we let $z=a\cos t+ib\sin t$ and $dz=(-a\sin t+ib \cos t)dt$. Note that the integral around the ellipse $C'$ is
$$\begin{align}
\int_0^{2\pi}\frac{dt}{a^2 \cos^2t+b^2\sin^2t}&=\oint_{C'}\frac{1}{ab}\text{Im}\left(\frac{\bar z\,dz}{|z|^2}\right)\\\\
&=\oint_{C'}\frac{1}{ab}\text{Im}\left(\frac{dz}{z}\right)\\\\
&=\frac{1}{ab}\text{Im}\left(2\pi i\right)\\\\
&=\frac{2\pi}{ab}
\end{align}$$
again as expected.