Two concentration units, one letter apart, and the difference is in the denominator.
molarity = moles ÷ litres of solution; molality = moles ÷ kilograms of solvent
Ten grams of sodium chloride, molar mass 58.44, is 0.1711 moles. Dissolved to a final volume of 500 millilitres, the molarity calculator gives 0.3422 mol/L. The same 0.1711 moles added to 500 grams of water gives 0.3422 mol/kg on the molality calculator.
Identical numbers, and that is the trap. They agree here because a litre of water weighs about a kilogram, and they agree only approximately, only for dilute aqueous solutions, and only at around room temperature.
Two differences, not one
The first is what is being measured. Molarity divides by the volume of the finished solution, which includes the solute. Molality divides by the mass of the solvent alone, before the solute went in. For a concentrated solution those are substantially different quantities, because dissolving something changes the volume in ways that are not simply additive.
The second is temperature, and it is the one that decides which unit a method specifies. Heat a solution and it expands, so the same number of moles now occupies more litres and the molarity falls without a single molecule leaving. The mass of solvent has not changed at all, so the molality is exactly what it was.
That is why molarity is the working unit in a lab at a controlled temperature, where volumetric glassware makes it the easy measurement, and molality is the unit in any calculation involving temperature change.
Colligative properties need molality
Freezing point depression, boiling point elevation and osmotic pressure all depend on how many solute particles are present per unit of solvent. Since those calculations are about what happens as the temperature moves, using a unit that itself moves with temperature would be circular.
So freezing point depression takes molality, and the post on why salt melts ice covers what that calculation is actually describing. Every textbook that insists on molality for these and molarity for titrations is making exactly this distinction, usually without saying so.
A third option when neither fits
For mixtures where there is no obvious solvent, or where you are working with vapour pressures and gas-phase equilibria, mole fraction is the honest unit: moles of one component over total moles, dimensionless, and immune to both volume and mass bookkeeping.
The habit worth forming is to read the denominator rather than the name. Per litre of what, per kilogram of what, and measured at which temperature. Most concentration errors are not arithmetic mistakes, they are a correct calculation performed on a quantity that was not what the method meant.