$$\lim_{x\to\ \frac{\pi}{2}^-}\frac{1}{x-\frac{\pi}{2}}+\tan x $$
Can anyone give me a hint I'm struggle.
Edit maybe I should say what I've done:
I used the following change of variable: $t=x-\frac{\pi}{2}$ so I got:
$$\lim_{t\to\ 0^-}\frac{1}{t}+\tan \left(t+\frac{\pi}{2}\right)$$
$$\lim_{t\to\ 0^-} \frac{1+t\tan\left(t+\frac{\pi}{2}\right)}{t} $$
I used B.H and I got something like $\frac{1}{0}$ so it's undefined...

As you've already found, the limit is $\lim_{y\to 0^+}(\cot y -\frac{1}{y})$. For small $y$, $\cot y=\frac{\cos y}{\sin y}\approx\frac{1}{y}\frac{1-y^2/2}{1-y^2/6}\approx\frac{1}{y}(1-y^2/3)$ so $\cot y -\frac{1}{y}\approx-\frac{y}{3}$. The limit is therefore $0$.