The average temperature of the universe is downright cold – right around 3 degrees above absolute zero.
In order to measure the temperature deep space there must be a substance, because this is how we define temperature. The temperature of the room you’re sitting in right now is determined by the average motion of all the air molecules in the room. The more energy they have, the faster they fly around, and the higher the temperature. If you touch a really hot object, its atom and molecules are vibrating furiously, giving it a very high temperature.
There isn’t a lot of matter in interstellar space. The average density of the universe is roughly only one hydrogen atom per cubic meter. This makes it very difficult to assign a temperature to the matter of interstellar space. But space itself is soaked in something else, an unending sea of radiation that is very, very cold.
This radiation comes from stars, galaxies and more, but by far the largest source of radiation in the universe is the cosmic microwave background (or CMB). The CMB emerged when the universe was about 380,000 years old. At that time our cosmos was about a million times smaller than it is today and it was in a hot dense plasma state. As the universe expanded and cooled the universe became neutral, releasing radiation that had a temperature of about 10,000 Kelvin, the same temperature as the surface of the Sun.
That radiation accounts for over 99.999% of all the radiation remaining in the cosmos. Since the time it was released, our universe has expanded, which has diluted that same radiation, lowering its temperature. In addition, the cosmic expansion stretches on light itself moving it to longer, cooler wavelengths.
The combined action of this expansion has dropped the temperature of the CMB to right around 3 degrees above absolute zero. That means that if you were to sit in interstellar space, your body would cool and cool and cool towards absolute zero. But it would be prevented from reaching that temperature because the cosmic microwave background radiation would always be hitting you, transferring their energy into your body. So you wouldn’t reach absolute zero, but you would come into equilibrium with the CMB, and that’s how we determine the (cold) temperature of interstellar space.