If a in RR then a^2 >= 0. So there is no Real square root of -16.
If i is the imaginary unit, then i^2 = -1 and we find that:
(4i)^2 = 4^2*i^2 = 16 * -1 = -16
So 4i is a square root of -16.
Also:
(-4i)^2 = (-4)^2*i^2 = 16 * -1 = -16
So -4i is a square root of -16.
If x in RR and x < 0 then sqrt(x) stands for the principal square root of x defined as:
sqrt(x) = i sqrt(-x)
In our case:
sqrt(-16) = i sqrt(16) = 4i
Note that you do need to be slightly cautious when dealing with square roots of negative numbers. In particular, the property sqrt(ab) = sqrt(a)sqrt(b) fails if a, b < 0:
1 = sqrt(1) = sqrt(-1 * -1) != sqrt(-1)sqrt(-1) = (sqrt(-1))^2 = -1