Recommended · for beginners
PWM VS Potentiometer! When to use which technique?
Why people recommend it
A GreatScott comparison of PWM against a variable resistor for dimming or speed control, showing how much power a resistor wastes as heat.
Watch for: Good argument for PWM over resistors in LED lighting
In their words
The basis of my experiment is inspired by results seen in GreatScott's video on this subject.
D. Gerling on electronics.stackexchange.com, Mar 2016. CC BY-SA.
This video can provide you more perspective.
Mayank on electronics.stackexchange.com, Jun 2017. CC BY-SA.