I'm sure an expert will be along in a minute. You know about the radiators in the cargo bay doors, right?
Between the sun radiating heat energy, and the heat generated by the equipment, they need to keep the shuttle cool. They pump some sort of coolent liquid through the radiators to cool it down (it's something like -270 degrees in space where the sun does not shine.) The shuttle air is blown across a heating/cooling unit, that is thermostatically controlled. the air is cooled or heated in the various spaces as needed. It works very similar to shipboard air circulation/heating/cooling systems.