Without an atmosphere to insulate it, the temperature of the moon can swing wildly. So, on the dark side of the moon it’s cold, while on the bright side its hot! How do we know this? Firstly, people have been there with thermometers (which helps). Secondly, we work out a lot of Physical principles about things heat and cool down on earth and assume that these theories also apply elsewhere in the Universe, including on the moon. The nice thing about science is that property of being able to generalize works!
The moon is most certainly cold. Being in space, the moon exists in a vacuum. Due to the lack of any major atmosphere, heat dissipates very quickly. Although the temperature of space varies depending on the make-up of the space (our area of the universe is almost entirely empty), the temperature is approximately 2.725 Kelvin or almost -270 degrees Celsius. That’s pretty cold!
As the atmosphere is pretty much a vacuum so there is no insulation to maintain any stable temperature. I would say its cold, really really cold – but on the side facing the sun it could be hot. I am sure that the NASA moon landings in the 1960s sent the astronauts to the moon wit thermometers to measure the temperature but how reliable that would have been is questionable.
It can be both! Because the moon has very little atmosphere, when the sun shines the moon can rise to 123oC (well above the boiling point of water) and when there is no sun the moon temperature can fall to -233oC. Think about that when in the UK we struggle when the temperature rises above 20oC or falls below 0oC.