I am doing a problem to optimize $3x-y+5$ subject to $x^2+y^2=1$ Algebraically it means which point on the unit circle maximizes or minimizes the value $3x-y+5$. So i took a generic point $P(\cos t,\sin t)$ on the unit circle.
Now we have $$3x-y+5=3\cos t-\sin t+5=\frac{3}{\sqrt{10}}\cos\left(t+\alpha\right)+5$$ So $$3x-y+5 \in \left[5-\frac{3}{\sqrt{10}}, 5+\frac{3}{\sqrt{10}}\right]$$ Where $\cos \alpha=\frac{3}{\sqrt{10}}$. But geometrically i could not picturize?

You can let the value of $3x-y+5$ vary so that you have a sliding line with slope equal to $3$ and look at the intersections with the unit circle. With this approach it is clear that the minimum and the maximum are at the tangent points of the family of lines $y=3x+5-k$ and the circle.
You can equate the slope of the tangent of the circle to $3$ to find the minimum and the maximum so
$$\pm\frac{x}{\sqrt{1-x^2}}=3 \implies x = \mp\frac{3}{\sqrt{10}}$$
then the minimum and maximum are at $(-\frac{3}{\sqrt{10}}, \frac{1}{\sqrt{10}})$ and $(\frac{3}{\sqrt{10}}, -\frac{1}{\sqrt{10}})$ with values $5-\sqrt{10}$ and $5+\sqrt{10}$ respectively.