It's a theorem.
Assuming that $e^z$ is defined as $\sum\limits_{n=0}^{\infty}\frac{z^n}{n!}$ (remember that there are a few ways of defining $e$), we have:
$$e^{i\theta}:=1+i\theta+\frac{\theta^2i^2}{2!}+\frac{\theta^3i^3}{3!}+\frac{\theta^4i^4}{4!}+\frac{\theta^5i^5}{5!}+\cdots=$$
Simplifying this, we find that $$\boxed{e^{i\theta}\equiv1+i\theta-\frac{\theta^2}{2!}-\frac{i\theta^3}{3!}+\frac{\theta^4}{4!}+\frac{i\theta^5}{5!}-\cdots}$$
Now, $\color{blue}{\underbrace{\cos(\theta)=1-\frac{\theta^2}{2!}+\frac{\theta^4}{4!}-\frac{\theta^6}{6!}+\cdots}_{\text{Taylor expansion of} \cos(\theta)}}$.
Also, $\underbrace{\sin(\theta)=\theta-\frac{\theta^3}{3!}+\frac{\theta^5}{5!}-\frac{\theta^7}{7!}+\cdots}_{\text{Taylor expansion of} \sin(\theta)}\iff \color{green}{i\sin(\theta)=i\theta-\frac{i\theta^3}{3!}+\frac{i\theta^5}{5!}-\frac{i\theta^7}{7!}+\cdots}$.
Now, $\color{blue}{\cos(\theta)}\color{\green}{+i\sin(\theta)}=\color{blue}{1}\color{green}{+i\theta}\color{blue}{-\frac{\theta^2}{2!}}\color{green}{-\frac{i\theta^3}{3!}}\color{blue}{+\frac{\theta^4}{4!}}\color{green}{+\frac{i\theta^5}{5!}}\color{blue}{-}\cdots=e^{i\theta}$.