We have indeterminateness of type
0/0,
i.e. limit for the numerator is
$$\lim_{x \to 0^+}\left(- \cos{\left(a x \right)} + 1\right) = 0$$
and limit for the denominator is
$$\lim_{x \to 0^+}\left(- \cos{\left(b x \right)} + 1\right) = 0$$
Let's take derivatives of the numerator and denominator until we eliminate indeterninateness.
$$\lim_{x \to 0^+}\left(\frac{- \cos{\left(a x \right)} + 1}{- \cos{\left(b x \right)} + 1}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{\frac{\partial}{\partial x} \left(- \cos{\left(a x \right)} + 1\right)}{\frac{\partial}{\partial x} \left(- \cos{\left(b x \right)} + 1\right)}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{a \sin{\left(a x \right)}}{b \sin{\left(b x \right)}}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{\frac{\partial}{\partial x} a \sin{\left(a x \right)}}{\frac{\partial}{\partial x} b \sin{\left(b x \right)}}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{a^{2} \cos{\left(a x \right)}}{b^{2} \cos{\left(b x \right)}}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{a^{2}}{b^{2}}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{a^{2}}{b^{2}}\right)$$
=
$$\frac{a^{2}}{b^{2}}$$
It can be seen that we have applied Lopital's rule (we have taken derivatives with respect to the numerator and denominator) 2 time(s)