Atoms are far too small and far too many to count one by one, so chemists weigh them instead. One mole is 6.02 × 10²³ particles, and a mole of any substance has a mass in grams equal to its relative mass. Raise the sample mass and watch the moles, molecules and atoms climb together.
One mole is always 6.02 × 10²³ particles, so dividing a weighed mass by molar mass, n = m/M, tells you how many moles, and so how many atoms or molecules, are in the sample.