Molar Mass is the general name used for the mass of 1 mole of substance (i.e. element, compound, etc). For example, the molar mass of an element is called the Atomic mass (that can be obtained from the Periodic Table) or for a molecular compound it is called the Molecular Weight.

To be able to calculate Molar mass of compounds, you need to know how a ratio of basic unit / particles of a compound is equivalent to the mole ratio of those basic unit / particles. The following math shows how they are equivalent:

Now, with this understanding, you can calculate the Molar mass of any compounds. It is simply the total mass of each of the elements in a mole of the compound (here we will assume an atom and an ion have the same mass). Then you sum the total mass of all the elements in the compound to get the mass you need to weigh out to get 1 mole of the compound.

As an analogue, you only know the mass of a fruit basket if you know the mass of each fruit and how many of them they are. It is the same calculation for finding the mass of 1 mole of a compound knowing the subscripts of each element/ion and atomic mass of the element/ion.

Below, you will find an example of the calculations with all units so that all units will cancel correctly, then what I expect you to write for all molar mass calculations and then the special case when you have Chlorine (with an odd subscript).