Consider the case $\ f(t) = 2 \cos(\omega_0 t) = e^{+i \omega_0 t} + e^{-i \omega_0 t}.\ $ Then
$$
F(\omega) = \int\limits_{-\infty}^{+\infty} e^{i (-\omega + \omega_0) t} \ dt + \int\limits_{-\infty}^{+\infty} e^{i (-\omega - \omega_0) t} \ dt\\
$$
When $|\omega| \ne |\omega_0|$, both integrands oscillate around zero, and the integrals are effectively zero. The only non-zero results are
$$
F(\omega_0) = \int\limits_{-\infty}^{+\infty} e^{i (0) t} \ dt + \int\limits_{-\infty}^{+\infty} e^{i (-2 \omega_0) t} \ dt\ =\ \int\limits_{-\infty}^{+\infty} 1 \ dt\ +\ 0\\
F(-\omega_0) = \int\limits_{-\infty}^{+\infty} e^{i (2 \omega_0) t} \ dt + \int\limits_{-\infty}^{+\infty} e^{i (0) t} \ dt\ =\ 0\ +\ \int\limits_{-\infty}^{+\infty} 1 \ dt
$$
which is often expressed as $F(\omega) = \delta(\omega - \omega_0) + \delta \big(\omega -(-\omega_0)\big) = \delta(\omega - \omega_0) + \delta(\omega + \omega_0).$
In words, for any given value of argument $\omega$, the $e^{-i\omega t}$ factor translates the component of $f(t)$ at that frequency to $0$, and all other components away from zero. Then the infinite integral produces a measure of the strength of the component at $0$.
Note that if $f(t) = e^{i\omega_0 t}$, then $F(\omega) = \delta(\omega - \omega_0)$. What this actually means is that the sign of $\omega_0$ can be unambiguously deduced from the function $e^{i\omega_0 t}$. It cannot be deduced from $\cos(\omega_0 t)$, because it is trigonometrically identical to $\cos(-\omega_0 t)$. The Fourier transform handles this ambiguity by giving non-zero responses at both $\omega=\omega_0$ and $\omega=-\omega_0$. That does not mean $\cos(\omega_0 t)$ contains both frequencies, because $\omega_0$ can have only one value. The correct interpretation is that $e^{i\omega_0 t}$ contains more information, not less, than $\cos(\omega_0 t)$. The formula $\ e^{+i \omega_0 t} + e^{-i \omega_0 t}\ $ looks like more information, but it is actually a cancellation of information.