If you could travel from world to world, from star to star, out into the gulfs of intergalactic space, you'd move away from the warmth of the stars into the vast and cold depths of the void. Better pack a sweater, it's going to get cold.
But, how cold? How cold is space?
Unlike your house, car, or swimming pool, the vacuum of space has no temperature. It's only when you put a thing in space, like a rock, or an astronaut, that you can measure temperature.
Remember there are three ways that heat can transfer: conduction, convection, and radiation.
Heat up one side of a metal bar, and the other side will get hot too; that's conduction. Circulating air can transfer heat from one side of the room to another; that's convection. But out in the vacuum of space, the only way heat can transfer is radiation.
Photons of energy get absorbed by an object, warming it up. At the same time, photons are radiating away.
If the object is absorbing more photons than it emits, it heats up. And if it emits more photons than it absorbs, it cools down.
There is a theoretical point at which you can't extract any more energy from an object, this minimum possible temperature is absolute zero.