How do we get the power spectrum through the CMB? How do we get the power spectrum through observing the CMB?
 A: First you have to perturb the background universe (FLRW metric) because the universe is no longer homogeneous and isotropic at small scales.
$$ g_{\mu\nu} =  \bar{g}_{\mu\nu} + \delta g_{\mu\nu} \:. $$ This perturbed metric must satisfy the Einstein Field Equations.
$$ G_{\mu\nu} = k T_{\mu\nu}\:.$$
Then you are going to find the equations of motion of the perturbations. In addition to these equations, we have the Boltzmann equations for Cold Dark Matter, photons, baryons and neutrinos,
$$ \frac{d f}{dt} = C[f] \:, $$
where $f$ is the distribution function and $C[f]$ is the collision term and it's determined via the Fermi golden rule. We are interested in perturbations of photons, so we have to perturb the Boltzmann equation for photons.
$$ f =\left[\exp \frac{p}{T[1 + \Theta]}-1\right]^{-1} \:, $$
where $\Theta = \frac{\delta T}{T}$. For the derivation of these equations you can look the book "Modern Cosmology" by Scott Dodelson.
Then, we have to solve the equations. We need to expand in multipoles $\Theta_l$ the Boltzmann equation perturbed for photons $\Theta$ to finally plot the power spectrum of the temperature perturbation of the photon $$C_l  \:\:\mbox{vs} \:\:l $$
It's not as easy as it seems. There are a lot of calculations behind. For more details you can see the book and this paper https://arxiv.org/abs/astro-ph/0606683
