Art of Electronics 3rd ed. Figures 1.83., 1.84., 1.85
Push the button to see the effect of breaking the current trough the inductor.
Use the upper left switch to use the parallel diode to protect the switch.
The upper right switch connects the RC "snubber" for supressing the inductive kick.
Blue: current trough switch
Green: voltage between the terminals of the switch