Oh god, the moles...
yeah use the mole ratio, and if they give out the mass in grams you have to find the molar mass of the molecule, that is you need to use your periodic table.
To find molar mass:
1) list all type of atoms in the molecule
e.g. H20
2H
1O
2) then find the atomic mass unit of the elements.
2H -> 2 * X where X is the atomic mass unit of one hydrogen atom
1O -> 1 * Y where Y is the atomic mass unit of one oxygenn atom
treat them as grams.
3) add 2*X to 1*Y and you got your molar mass
4) next to find the mole multiply the grams you were given in the
question to avogadro's number divided by molar mass.
If you have to find H in for example H2O-> 2H + O2, then multiply the moles of H2O that you just calculated to 2/1 because for 1 H2O, it produced 2H. The mole ratio. Hope that sort of make sense.