Fourier realized that any periodic or bounded-domain function can be written as a linear combination of sine and cosine functions at different frequencies.
The cosine function $\cos k t$ has wavenumber $k$. Suppose $t$ is time, measured in seconds. Then $k$ is the number of cycles per $2\pi$ seconds (see the figures below).
The function has period $T = {2 \pi \over k}$ if measured in seconds, and frequency $\omega = {k \over 2 \pi}$ if measured in 1/second, or "per second", or Hertz (Hz). Note that $\omega$ is "omega", not the letter "w".
The Fourier basis functions are
$\sin k\:t, \cos k\:t\ \text{for}\ k \in { 0, 1, 2, \ldots }$
$\sin 0t, \cos 0t, \sin 1t, \cos 1t, \sin 2t, \cos 2t, \sin 3t, \cos 3t, \ldots $
These basis functions are orthogonal. For all $m \neq n$:
$\begin{array}{r} \sin mt \cdot \sin nt = 0 \\ \cos mt \cdot \cos nt = 0 \end{array}$
and
$\begin{array}{r} \sin mt \cdot \cos nt = 0 \\ \sin mt \cdot \cos mt = 0 \end{array}$
Given an arbitrary periodic $f(t)$, we project it onto all of these basis functions and get the Real Fourier Series:
$\begin{array}{rl} f(t) & = \sum_{k=0}^\infty\limits a_k \cos k t\ \ +\ \ \sum_{k=0}^\infty\limits b_k \sin k t \\ & = a_0 + \sum_{k=1}^\infty\limits a_k \cos k t\ \ +\ \ \sum_{k=1}^\infty\limits b_k \sin k t \\ \end{array}$
The $a_k$ and $b_k$ show how much of $\cos kt$ and $\sin kt$ are present in $f(t)$.
To get $a_k$ and $b_k$, project $f(t)$ onto the basis functions:
$\begin{array}{rl} a_k & = \displaystyle { f(t)\ \cdot\ \cos kt \over \cos kt\ \cdot\ \cos kt} \\ \\ & = \displaystyle { \int_0^{2\pi} f(t) \cos kt\ dt \over \int_0^{2\pi} \cos^2 kt\ dt } \\ \\ & = \displaystyle { \int_0^{2\pi} f(t) \cos kt\ dt \over \pi } \\ \\ & = \displaystyle { 1 \over \pi } \int_0^{2\pi} f(t) \cos kt\ dt \\ \\ \\ b_k & = \displaystyle { f(t)\ \cdot\ \sin kt \over \sin kt\ \cdot\ \sin kt} \\ & = \displaystyle { \int_0^{2\pi} f(t) \sin kt\ dt \over \int_0^{2\pi} \sin^2 kt\ dt } \\ & = \displaystyle { \int_0^{2\pi} f(t) \sin kt\ dt \over \pi } \\ & = \displaystyle { 1 \over \pi } \int_0^{2\pi} f(t) \sin kt\ dt \end{array}$
Note that
$\begin{array}{rl} a_0 & = \displaystyle { \int_0^{2\pi} f(t)\ dt \over 2 \pi } \\ \\ b_0 & = \displaystyle 0 \end{array}$
So $a_0$ is the average of $f(t)$ on the interval $[0,2\pi]$.
Given $a \cos t + b \sin t$, what is the corresponding $A \cos(t - \theta)$ ?
Recall that $A \cos(t - \theta) = (A \cos\theta) \cos t + (A \sin\theta) \sin t$.
So, given the $a$ and $b$ in $a \cos t + b \sin t$, we can find the $A$ and $\theta$ of the corresponding $A \cos(t - \theta)$:
$\begin{array}{rcl} a & = & A \cos\theta \\ b & = & A \sin\theta \\ a^2 + b^2 & = & A^2 (\cos^2\theta + \sin^2\theta) = A^2\\ A & = & \sqrt{ a^2 + b^2 } \\ \\ {b \over a} & = & { A \sin\theta \over A \cos\theta} = \tan\theta \\ \theta & = & \arctan { b \over a } \end{array}$
This works for any wavenumber, $k$.
So the $k^{th}$ sin/cos pair can be thought of as a shifted, modulated sinusoid of wavenumber $k$.
$a_k \cos kt + b_k \sin kt = A_k \cos(k \; t - \theta_k)$where $a_k = A_k \cos k\theta_k$ and $b_k = A_k \sin k\theta_k$.
In other words, it's a single sinusoid where $A_k = \sqrt{a_k^2 + b_k^2}$ is the amplitude and $\theta_k = \arctan{b_k \over a_k}$ is the phase shift.