Molarity represents the concentration of as solution expressed in number of moles of solute per liter of solution.
#molarity = ("moles of solute")/("liters of solution")#
So, let's say you want to make a solution of sucrose (table sugar - #C_12H_22O_11#), so you add 15 g of sucrose to 500.0 mL of water.
You first determine the number of moles of solute - in this case, sucrose:
#n_(sucrose) = ("mass")/(" molar mass") = (15.0g)/(246 g/(mol)) = 0.061# moles
Therefore, your solution's molarity will be
#C = (0.061 "moles")/(500.0 * 10 ^(-3) L) = 0.12# #"moles/L"#
Notice that I've converted mL to L.
As a strategy, always try to determine how much of something - number of moles - is added to what volume of solution.
You can find other examples here