How to stop DC PWM fan with Arduino uno and temperature sensor

You have tested with analogWrite() and the fan did not spin? Or did it spin but make a loud sound?

This library you are using. It it set to 25KHz by default? Is that frequency chosen to be outside human hearing range?