You can check that the limit comes in an undefined form:
[tex]\displaystyle \lim_{x\to\frac{\pi}{3}} \frac{2\cos(x)-1}{\tan^2(x)-3}=\dfrac{0}{0}[/tex]
In these cases, we can use de l'Hospital rule, and evaluate the limit of the ratio of the derivatives. We have:
[tex]\dfrac{\text{d}}{\text{d}x}2\cos(x)-1 = -2\sin(x)[/tex]
and
[tex]\dfrac{\text{d}}{\text{d}x}\tan^2(x)-3 = 2\dfrac{\tan(x)}{\cos^2(x)}=\dfrac{2\sin(x)}{\cos^3(x)}[/tex]
So, we have
[tex]\displaystyle \lim_{x\to\frac{\pi}{3}} \frac{2\cos(x)-1}{\tan^2(x)-3}=\lim_{x\to\frac{\pi}{3}} \dfrac{-2\sin(x)}{\frac{2\sin(x)}{\cos^3(x)}}=\lim_{x\to\frac{\pi}{3}}-\cos^3(x)=-\cos^3\left(\dfrac{\pi}{3}\right)[/tex]