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