Adding to Ethan's answer: Beginners sometimes write things like "$\sqrt{-4}=\pm2i$", but this isn't actually an equation; it's shorthand for the sentence "If $z^2=-4$, then $z=2i$ or $z=-2i$".
You shouldn't do algebra with an expression like $\sqrt{-4}$ that doesn't denote exactly one number, because you'll quickly lose track of the "or".
For example, say we know that $a^2=-1$ and $b^2=-1$.
Is it possible that $a\times b=1$? Yes, because we could have $a=i$ and $b=-i$.
Is it possible that $a\times a=1$? No, because this is $a^2$, which we've assumed is $-1$.
But if you write $a=\sqrt{-1}$ and $b=\sqrt{-1}$ and substitute these "values" into the expressions above, then you get "$\sqrt{-1}\times\sqrt{-1}$" for both, and you've lost information. The best way to avoid this kind of confusion is to explicitly keep track of the cases instead of trying to use "$\sqrt{}$" (or "$\pm$") expressions to denote multiple values at once.