Are you asking how to use atan2, or how to implement it?
$\mathrm{atan2}(y,x)$ gives you the angle between the x-axis and the vector $(x,y)$, usually in radians and signed such that for positive $y$ you get an angle between $0$ and $\pi$, and for negative $y$ the result is between $-\pi$ and $0$.
It's named that way because when $x$ is positive, $\mathrm{atan2}(y,x)=\tan^{-1}(\frac{y}{x})$, which also explains (more or less) why the arguments are "backwards".
So if you have the vector $(\sqrt 3/2, -1/2)$ you can get its angle by $\mathrm{atan2}(-1/2, \sqrt 3/2)$ which is $-\pi/6$. You then know that for some positive $r$ it holds that $(\sqrt 3/2, -1/2) = r(\cos(-\pi/6), \sin(-\pi/6))$ (in fact it turns out that $r=1$ in this case, but atan2 does not tell you that).
As for implementing atan2 in the (these days somewhat unusual) case that you don't have a hardware implementation available, I think CORDIC should give excellent results with little effort. Alternatively, you can sacrifice precision for table space by splitting into octants, dividing the numerically smaller argument by the larger, and using a polynomial approximation of the arctangent between 0 and 1.