$$\begin{align}
e^{i\theta}&=\cos\theta+i\sin\theta \\[0.5em]
\left|e^{i\theta}\right|&=\sqrt{\cos^2\theta+\sin^2\theta}
\end{align}$$

I get that the magnitude of $e^{i\theta}$ has to be $1$, but why does that $i$ squared become $1$? Isn't $i$ squared supposed to be $-1$?