They don't. Not very well anyway. It's a major engineering challenge to relocate the heat away from crew areas and towards areas that are very large and pointed away from the sun.
On earth we take advantage of the huge amount of stuff around us to move heat around and get things the temperature we want. Take some ambient temperature gas, manipulate it just right and you can move the heat from one part to another. Put that next to a hot room and the room tries to equalize with the gas. Move the gas back to the start and repeat and you're moving heat around. It works because we have stuff to use as a heat sink.
In space, that doesn't work. There's nowhere to move it. You need to rely on things emitting a little bit if light proportional to their temperature. Glowing with heat is something everything does, it's just usually not visible when you or I do it. It's how thermal cameras work.
So things in space cool down by gently glowing. It's not very fast and is nowhere near as efficient as dumping hot water on the ground.