The buck regulator has two different states, when switch S is closed and when switch S is open. When the switch is closed, current from VIN charges flow through the inductor, charges the capacitor, and supplies the output load current. When the switch is open, the magnetic field in the inductor collapses and causes the voltage across the inductor to change polarity. This change in polarity pulls the phase node below ground, forward biasing the diode. This allows current to continue to flow as the inductor sources the current needed by the load.