You can use a temperature sensor such as the LM35DT. This particular sensor has a linear output of 10mV / C (centigrade). Being that the output is very small, you might want to amplify that using an Op-amp IC.
Then you can feed the output of the Op-amp into one of the inputs of a comparator circuit. The other input of the comparator can be used as the reference voltage ( which indicates ref temp). So for example, if the output of the op-amp is greater than the reference voltage ( meaning the Temp is higher than a reference Temp), and the output of the op-amp is fed into the positive input, then the output of the comparator will be a High(Logic 1), which then can be used to turn on a switch of some sort.
Or you can implement all of this using a micro-controller.