Please re-read your last post. I think that it should be obvious that RELAY1 and RELAY2 are terrible names. HeaterRelayPin and CoolerRelayPin would tell us EXACTLY what is being switched. 0 and 1 are useless values. #define ON x and #define OFF x, and turning a relay pin ON would tell us EXACTLY what you expect to happen (with appropriate values for x in each case).
Look at your code. It looks like it was typed by a drunken monkey. Use Tools + Auto Format, and get that monkey into treatment.
Finally, that snippet of code only deals with temperatures less than 23 or greater than 27. It makes NO changes to the state of the heater and cooler relay pins when the temperature is 23, 24, 25, 26, or 27 degrees. That is probably not what you really want.