Recommended · for some experience
#138 Variable Speed Cooling Fan for Raspberry Pi using PWM and PID controller
Why people recommend it
Suggested for adding temperature-driven fan speed control to a Raspberry Pi with a transistor and PWM, which also reduces fan noise; Andreas Spiess made it.
Watch for: also covers PID control and MOSFET basics