You don't need to know where it comes from. There are several proofs, the most direct and popular one is using Taylor series, which is beyond the scope of the 4u syllabus. There's also another proof that involves integrating an expression where they treat i as a constant, but it's not popular since you need to be careful when you mix complex numbers and integration.

Here's a relatively simple proof if you're interested:

Take limit as n->infinity:

cos X -> 1 and sin X -> X if X is small, so

The RHS is the definition of the exponential function, hence