This circuit is being used outside a PC.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
The average PC fan is not a simple motor that can be controlled by changing the supply voltage. The speed is varied by using a pwm signal. There should be plenty of examples on the interwebs on how to vary the speed based on temperature etc using an Arduino or suchlike. Note that this site is for Q and A and not a design on request service.
4-wire computer fans have been around for a long time. Most of them function according to a standard written by Intel (available here.) Having a standard means that any fan from any manufacturer can be controlled in the same way. In a nutshell, VCC and GND are power inputs with VCC usually being 12V. TACH is an output that pulses twice per revolution, and PWM is an input that is used to control the speed of the fan. Usually, the PWM pin has an internal pull-up which means that if you disconnect it, it will rise to 5V by itself. In the disconnected state the fan will run at full speed. If you connect the PWM pin to GND the fan will stop. Speeds between 0% and 100% can be achieved by applying a 25kHz Pulse Width Modulated (PWM) signal to the PWM pin. You didn't ask about controlling the speed of the fan, only turning it on and off, so I won't explain how to generate a PWM signal; there are many web sites explaining how to do it with an Arduino or similar.
So the right way to turn the fan on and off is to measure the temperature. If the temp is below some threshold temperature, then connect the PWM pin to GND. If it's above the threshold, then disconnect the PWM pin. There are MANY ways to accomplish that.
The circuit below uses a LM393 open collector comparator. A NTC thermistor and a fixed resistor form a voltage divider that depends on temperature; the output voltage rises as the temperature goes up. The LM393 compares this voltage to the output of a potentiometer used as a voltage divider. If the thermistor voltage is lower than the pot voltage, then the LM393 "turns on" connecting the PWM pin to GND. If the thermistor voltage is higher, then the LM393 turns off and disconnects the PWM pin.
This circuit can be improved in many ways, but the simplicity seems appropriate here.