The number of moles is related to the amount of a substance we have. If we were to use the number of particles, the numbers would be huge and impractical to use. So, Avagadro's number provides us a link with the number of moles of something, and the number of particles.
n = N x NA
Where, n = number of moles N = number of particles NA = avagadro's number (6.022 x 10^23)
Particles can be anything - atoms, molecules, electrons, ions etc. Avagadro's number relates them all to one quantity.
Ratios of moles are very handy:
C + O2 -> CO2
1 mole of carbon + 1 mole of oxygen -> 1 mole of carbon dioxide
2Mg + O2 -> 2MgO
2 moles of magnesium + 1 mole of oxygen -> 1 mole of magnesium oxide
Even though in the above equations, carbon and magnesium are atoms and oxygen is a molecule, it is only the ratio of the two that matters.
Number of moles, n, is also used in many calculations, so it is useful to know where it originates from!