Molar mass is the sum of all atomic masses in a given compound in relative grams. To explain how to calculate the Molar mass, let me show you an example.
Calculate the Molar mass of H2O
now, atomic mass of H - 1
Atomic mass of O - 16
Now, molar mass = 1(2) + 16
= 2 +16
= 18 u = 18 grams (relative mass in grams)