How the FFT takes a cosine or sine and outputs the frequencies of the complex form?
I will try to explain it in an intuitive, not rigorous way.

The main idea behind the Fourier Transform is to "project" one signal $s(t)$ on another $\phi(t)$. If the projection is not zero, then $\phi(t)$ is "included" in $s(t)$, in the sense that you can write $s(t)$ as $$s(t) = A\phi(t) + \text{other signals},$$ with $A \neq 0$.

The projection is defined as $$A = \int_{-\infty}^\infty s(t) \phi^*(t)\,dt.$$

You can of course project $s(t)$ on multiple signals; you can find the projection on $\theta(t)$ $$B = \int_{-\infty}^\infty s(t) \theta^*(t)\,dt$$ and then you can say that $$s(t) = B\theta(t) + \text{other signals}.$$

In the case when the projection of $\phi(t)$ on $\theta(t)$ is zero (in this case they are said to be orthogonal), you can go further and say that
$$s(t) = A\phi(t) + B\theta(t) + \text{other signals}.$$ Since you found two components of $s(t)$, you can expect the "other signals" portion of this last equation to be "smaller" (have less energy) than when you project on $\phi(t)$ or $\theta(t)$ alone.

Now, what Fourier says is that if you project your signal on the set $\lbrace e^{j\omega t} \rbrace$, the "other signals" part of the equations above will be zero. So, this set is special: it's said to be a "complete" basis for all signals (it's not the only complete basis, though).

So, if you look at the Fourier Transform integral, you'll notice that it is projecting your time-domain signal on this complete set. It turns out that, when you project the cosine $\cos(\omega_0 t)$ on this set of exponentials, you get exactly two projections that are not zero. This means that the cosine can be written as the sum of these two projections.