Dimensional analysis is a general problem solving method.
It takes a written problem and gives it mathematical form by focusing on the units involved in the problem.
The expression can often be correctly evaluated simply by making sure that units cancel in a correct way.

Imagine you are asked to solve the following problem: What is the volume of a 3.2 g sample of aluminum, if the density of aluminum is 2.70 g/cm^{3} ?

You are likely to proceed inthe following manner.

$$
\begin{align*}
d &= \frac{m}{v}\\\\
dv &= m\\\\
v &= \frac{m}{d}\\\\
v &= \frac{3.2 \, g}{2.70 \, g/cm^3} \\\\
v & = 1.2 \, cm^3
\end{align*}
$$

This is fine, but solving the problem using dimensional analysis is much easier. You start by writing down the unique fact in the problem - the one that does not involve a ratio - the mass of 3.2 g. You then multiply that by the ratio so as to generate the desired unit for the answer - in this case cm^{3}. It now is a one step problem with no need to solve an equation for volume, or to even remember the density equation at all!

\begin{align*}
3.2 g \times \frac{ 1 \, cm^3}{2.70 \, g} = 1.2 \, cm^3
\end{align*}
This may seem like cheating, but it is sufficient for most chemistry problems since we are almost always dealing with ratios that show direct proportionality as in this case.
You should also get used to it since most chemistry texts rely on dimensional analysis without explicitly writing out the ratios involved.

##
Example 1: How many seconds are in 2.3 years?

We start with the unique fact given, 2.3 years, and write out the units we know for time unitl we arrive at the desired unit, seconds.

\begin{align*}
years \times \frac{days}{ year} \times \frac{hour}{day} \times \frac{minutes}{hour}
\times \frac{seconds}{minutes}\end{align*}
\begin{align*}
2.3\, years \times \frac{ 365.25 \, days}{1 \, year} \times \frac{24 \, hour}{ 1 \, day} \times \frac{60 \, min}{ 1 \, hour} \times \frac{60 \, seconds}{ 1 \, minute} \\\\
= 7.37 \times 10^7 seconds
\end{align*}

##
Example 2: How many nanoseconds are in 12.0 minutes ?

\begin{align*}
& min \times \frac{s}{ min} \times \frac{ns}{s}\\\\
& 12.0 \, min \times \frac{60 \,s}{ 1 \,min} \times \frac{10^9 \,ns}{ 1 \,s}\\\\
& 7.20 \times 10^{11} ns
\end{align*}

##
Example 3: What is the density of a substance in kg/m^{3} if it has a density of 13.6 g/cm^{3} ?

\begin{align*}
& \frac{g}{cm^3} \times \frac{cm^3}{ m^3} \times \frac{kg}{g}\\\\
& \frac{13.6 \,g}{ 1 \,cm^3} \times \frac{10^6 \,cm^3}{1 \, m^3} \times \frac{1 \,kg}{10^3 \,g}\\\\
& 13.6 \times 10^3 kg/m^3
\end{align*}