Do materials cool down in the vacuum of space?
If yes, how does it really work?
Heat is the thermal motion of particles. Hot object's atoms vibrate more than cold object's atoms. Heat is transfered by 3 main ways:
Conduction: Heat flows from hot objects to cold objects. If you have an electric stove, the heat flows from the coils to the pan.
Convection: Heat flows by bulk motion of a fluid. If you heard "hot air rises" this is the technical name for that effect.
Radiation: Anything with heat (meaning everything, since absolute zero is impossible) radiates away energy in the form of photons. The light from red hot steel is an extreme example of this, since the photons are energetic enough to have a short enough wavelength to be in the visible spectrum.
Only radiation is significant in the approximate vacuum of space. This is how the heat from the sun gets to earth, it showers us with lots of high energy photons all the time. Similarly, if you put in space a block of hot metal, it would slowly radiate away it's heat. Keep in mind though it would also absorb some radiation from the sun. The earth radiates away about as much heat as it absorbs, so it is in approximate thermal equilibrium.