The core idea
Divide the amount of dissolved solute in moles by the final volume of solution in liters. For 0.50 mol in 2.0 L, M = 0.25 mol/L. Do not use the volume of solvent alone.
Try it yourself
Open the Molarity Calculator and enter your own values. Keep units consistent and compare the answer with the worked explanation.
Check your work
Write down your known quantities, convert units before substitution and confirm that your final units match the quantity you intended to calculate.