Impurities (such as salt) readily dissolve into liquids (such as water), where they can circulate easily.
However, the impurities don’t boil away (their vapor pressure is low) and they tend not to be frozen into the solid (they don’t fit into the ordered crystal lattice).
So you have a situation where the concentration of the solvent is <100% in the liquid state but essentially 100% in the solid and gas states.
Now consider what the freezing and boiling points are: a balance between solid/liquid and liquid/gas, respectively. (The specific parameter that’s balanced is the chemical potential, which is like a sophisticated version of concentration.)
Reducing the concentration of the liquid upsets this balance and requires a temperature excursion past the original phase-change temperature, toward the temperature range of the more purer phase (colder for freezing, hotter for boiling) to drive the phase change to occur.
Another way to look it is that reducing the solvent concentration of the liquid from 100% to <100% lowers its Gibbs free energy curve:
The Gibbs free energy (which considers Nature’s favoring of both strong bonding in condensed matter and the many arrangements in a gas, as mediated by the temperature) is minimized for spontaneous processes and stable matter. The chemical potential is itself simply the Gibbs free energy per mole of substance.
Note how pushing the liquid curve down would push the intersections farther out. This provides a graphical explanation for why and how impurities depress the freezing while elevating the boiling point.
So why is salt used when making ice cream? It’s not added to the ice cream itself, of course; it’s added to ice surrounding the cream mixture we’re trying to freeze. Any salt touching the ice melts it, since—as described above—dissolved impurities make the liquid state more stable. But melting takes energy, quantified as the latent heat of fusion. This energy has to come from somewhere, and so the ice and ultimately the cream mixture tend to cool down, accomplishing our goal.