Avoid L'hopital's rule

$$\frac{\log\left(\cos\left(x\right)\right)}{\sin^{2}\left(x\right)}=\frac{1}{2}\frac{\log\left(1-\sin^{2}\left(x\right)\right)}{\sin^{2}\left(x\right)}=-\frac{\sin^{2}\left(x\right)+O\left(\sin^{4}\left(x\right)\right) }{2\sin^{2}\left(x\right)}\stackrel{x\rightarrow0}{\rightarrow}-\frac{1}{2}.$$


The expression equals

$$\frac{\ln (\cos x) - \ln (\cos 0)}{\cos x - \cos 0}\cdot\frac{\cos x - 1}{x^2}\cdot \frac{x^2}{\sin^2 x}.$$

The first fraction $\to \ln'(1) = 1,$ by definition of the derivative. The limit of the second fraction is standard and equals $-1/2.$ The third fraction $\to 1.$ So the limit is $-1/2.$


You can use the important limits: $\lim_{x\rightarrow 0}\frac{\sin x}{x} =1$ and $\lim_{x\rightarrow 0}(1+x)^{\frac{1}{x}}=e$ (i.e., $\lim_{x\rightarrow 0} \frac{\ln(1+x)}{x}=1$). Then \begin{align*} \lim_{x\rightarrow 0}\frac{\ln \cos x}{\sin^2 x} &= \lim_{x\rightarrow 0}\frac{\cos x -1}{x^2}\\ &=\lim_{x\rightarrow 0}\frac{-2\sin^2 \frac{x}{2}}{x^2}\\ &=-\frac{1}{2}. \end{align*}