Keeping things cool in space is very hard. On earth we usually transfer heat from one medium to another (water to water, water to air, etc.). In space that's not possible because even though the matter in space is quite cold, there is very little. Therefore the only real way to get rid of heat in space is to radiate it away (think infrared light bulb). The James Webb Telescope does the same thing.