The moles is the amount of a substance that we are measuring, its like measuring how many coins I have in my pocket, but instead how many atoms of an element we have. We use the equation moles=mass/RMM to work this out - where mass is how much the the element weighs and RMM is the relative molecular mass of the element we're looking at. Its important to realise that 1 mole of a compound is equal to 6.02x10^23 atoms, in a similar way 1 pound is equal to 100 penies.
The RMM adds together the weight of all the particles in 1 atom (of the element) therefore we can work out how many atoms there are in total. For example if I had 2g of carbon-12 (RMM of 12gmol^-1) and I wanted to work out how many moles this was I would do 2/12 to give 0.16778 mol, or in other words 1.42x10^17 atoms.