Select an example problem to demonstrate molarity. Suppose you dissolved 5 g of sodium chloride (NaCl) in 500 mL of water and wanted to determine the molarity of the final solution.
Calculate the number of moles in the NaCl (solute) first. To do this, you have to know the molecular weight of NaCl. Look at the Periodic Table of Elements and examine the atomic weight numbers for Na and Cl separately. You should get 23 g per mole for Na and 35.4 g per mole for Cl. Add the two up; you should get 58.4 g per mole for NaCl.
Divide the original amount, 5 g, by 58.4 g / mole to obtain the total moles. Notice how the grams cancel out and you are left with moles. Now divide the moles by 0.5 liters to get molarity. (Or you could multiply the result by two to get the same answer.) You should get 0.17 M.
Remember that when the problem gives you a solvent in milliliters instead of liters, you should convert it to liters before you begin other calculations. This is easily done by dividing the milliliters by 1,000.