Is it possible to find $\tan\theta$ by squaring both sides of $\sec\theta+\tan\theta=5$ right away? From $\sec\theta+\tan\theta=5$, in order to find $\tan\theta $ we can rewrite it as $\sec\theta=5-\tan\theta$ then square,
$$1+\tan^2\theta=\tan^2\theta-10\tan\theta+25\quad\Rightarrow\quad \tan\theta=\frac{24}{10}$$
But When I square the both sides of $\sec\theta+\tan\theta=5$ right away I get,
$$(1+\tan^2\theta)+\tan^2\theta+2\tan\theta\sec\theta=25$$
$$\tan^2\theta+\tan\theta\sec\theta=12$$
I'm wondering is it possible to find $\tan\theta$ from above equation?

The answer is no, not really.
In effect if $z=\tan \theta$ and $-\frac \pi 2 \lt \theta \lt \frac \pi 2$ then $\sec\theta+\tan\theta=5$ is equivalent to $\sqrt{1+z^2} +z=5$
If you just square both sides you then get $z^2 +z\sqrt{1+z^2}=12$ which does not take you forward; you still have the radical
while if you square both sides of $\sqrt{1+z^2} =5-z$ you get $1+z^2=z^2-10z +25$ and the solution $z=\frac{24}{10}$ as you found
