Strongly recommended · for beginners
Switch mode power supply tutorial: DC-DC buck converters
Why people recommend it
Widely praised as a clear introduction to step down switching regulators, covering why they beat linear regulators and how to build a simple one.
Watch for: the opening minutes explain the diode's role
In their words
For step-up/step-down DC-DC converter theory look here, here and here.
Maximilian Gerhardt on arduino.stackexchange.com, Mar 2018. CC BY-SA.
Watch the first 4 mins of this video, that'll answer your question:
Big6 on electronics.stackexchange.com, Feb 2020. CC BY-SA.