The Arduino will not drive a relay directly so you will need a driver circuit between the Arduino and the relay. That could be a simple transistor circuit, or some other form of driver circuit bought off the shelf, such as a relay shield.
There is a ‘Motors, Mechanics, and Power’ section of the forum dedicated to this subject and if you need help with that you should look there.
You will also need to connect the temperature sensor a read values from it. There is a wide selection of digital and analog temperature sensors and you should have no trouble finding examples of reading values from each one. I prefer the DS18B20 digital sensor since it is easy to use and gives accurate readings without having to worry about calibration, but there are plenty of alternatives.
Once you know how to read the temperature and control the relay, the code to switch the relay by comparing the temperature against two thresholds is trivial.
if(temperature() < LOW_THRESHOLD)
else if(temperature() > HIGH_THRESHOLD)
Here temperature(), heaterOn() and heaterOff() are functions that you would write to carry out these actions.