The truth is that space itself doesn't have a temperature. Think of it like this: temperature is a measure of how much the molecules in a substance are moving around. There are very few molecules in space, so the concept of temperature doesn't really apply.
What actually happens is that objects in space will either absorb or radiate heat.
* Direct Sunlight: If an object is facing the Sun, it will absorb a lot of radiation and get very hot. Think of a spaceship in direct sunlight - it will definitely heat up!
* Shadow: On the other side of the object, it will be in shadow and not absorb any radiation from the Sun. It will cool down very quickly due to radiating heat into the cold of space.
So, it's not the space itself that's extremely hot or cold, but rather the objects within it, depending on their exposure to sunlight and their ability to absorb or radiate heat.
Example: The International Space Station cycles through very hot and very cold temperatures as it orbits Earth. It's important to keep these temperature fluctuations in mind for any object in space, whether it's a spacecraft, a satellite, or even an astronaut!