Calculating $w=\sqrt {-i}$ I am looking at the following:
$w=\sqrt {-i}$.

Rewriting
$w=\sqrt {-i}=\sqrt{\exp(-i\frac{\pi}{2}+ik2\pi )}$

$w=\exp(-i\frac{\pi}{4}) \exp(i k  \pi)$

How do I know which is the correct answer for $w$?

Let's suppose we take the principal branch.
They are both correct. The numbers you have found are $\pm( \frac{\sqrt2}{2} -i\frac{\sqrt2}{2})$. There is not a natural single value.
$$-i=\cos{3\pi/2}+i\sin{3\pi/2}=\exp{i(3\pi/2)} \\
\sqrt{-i}=[\exp{i(3\pi/2)}]^{1/2}=\exp{i(3\pi/4)}=\frac{i-1}{\sqrt{2}}$$