This all means that space, the vacuum, is a perfect temperature insulator for convection heat. The only heat exchange that can be done between bodies in the vacuum is through radiation, because the vacuum lets electromagnetic energy pass through. Very fortunate, so we can get light and warmth from the Sun, all being through electromagnetic radiation. The frequency of this radiation is a measure for how much energy it transmits. The higher the frequency, the more powerful the radiation is and usually penetrates deeper into materials. X-rays have a very high frequency and are therefore powerful enough to penetrate our bodies, which for example is used in medical applications. Gamma rays are even more powerful and are generated by decaying atoms - nuclear radiation. Heat radiation is called infrared, because the color red is the lower frequency limit of what our eyes can see (violet the upper).
Infrared has a too low frequency for our eyes to see and we feel it as heat instead. Its frequency relates to the temperature of the emitting body, the higher the frequency, the warmer that body is. This causes the so called greenhouse effect, because certain materials are more transparent for higher than for lower frequencies. The surface temperature of the Sun is 6000 Kelvin and the according frequency can penetrate the Earth's atmosphere. As it hits the ground, most of it gets absorbed and warms up the ground material - ever noticed how hot beach sand can be?
However, the thus generated temperatures are much lower (fortunately) than that of the Sun and the Earth's atmosphere is not transparent for the according lower frequencies and so it warms up, partially by absorbing the energy that the warm ground radiates off and partially through convection heat exchange between air and ground material molecules and part by what it absorbs itself directly. The same principle is valid for glass and that's why your car gets so hot inside, when it is parked in the sun. Likewise the temperature in greenhouses rise above surrounding air temperatures, as is the purpose of them.
The warm atmosphere of the Earth radiates off heat into space at a far lower frequency than what it received from the Sun and this heat disperses into space, without "warming" it up. Space, the vacuum, cannot have a temperature and so the heat energy that the Earth's atmosphere radiates off, disperses into larger and larger volumes of "nothingness".
The Earth is thus not cooled by any "cold" space, because that would require convection, which the vacuum cannot provide. Likewise, the distant planets are very cold, because they receive very little energy from the Sun, not because they are surrounded by "cold" space.
Any mass object in "dark" space, not receiving any heat, nor generating any itself, will become extremely cold, as it radiates off whatever little it still has. How cold, we'll see at the end of this page. The average temperature of the Earth is determined by a balance between received and given off heat energy.
The atmosphere's temperature stabilizes there where both amounts are the same. Hence, the Earth gives off as much energy as it receives from the Sun; nothing is "consumed", or "used" as many erroneously think. The same is valid for a green-house and you car parked in the sun; the inner temperature stabilizes at a value where energy balance is reached. Of course, not all the solar energy that hits the Earth is absorbed by it.Much of it is reflected back into space. From the rest, the atmosphere absorbs a part itself and lets through a part to reach the surface.
As long as the properties of the atmosphere do not change, the Earth's global temperature will not change, but if we bring about noticeable changes with our emissions of whatever gases, anything can happen. The Earth can become cooler or warmer. Today the talk is about global warming, but there are scientists who argue for a risk of global cooling also. In the end, nobody knows for sure, because the heat-household of the atmosphere is a very complicated system, with many unknown parameters. However, if it ever would happen that we release so much heat from fuels, that it becomes a noticeable part of the Earth's total energy-household, we would indeed warm up Earth by it. I don't think that ever will happen, it's just a theoretical exercise, but we do cause heat-pollution locally, warming up waters around large power plants that are cooled by them and it affects the biological systems there.
On Earth, cars, green-houses and whatever other structures, are heavily cooled by the surrounding air, especially if there is wind blowing around them. Not so on the Moon for example. If you see SF-designs of huge glass cupolas on the Moon and spacecrafts with large glass windows all around, you are basically looking at ovens. If exposed to sunlight, they would self-destruct by overheat, unless practically all of the solar heat is reflected (not absorbed!) by such glass, or whatever transparent material.
Even then, such habitats are additionally heated by the body heat of people in there and by the power supplies to run technical systems (all energy decays to heat at ambient, in this case cabin temperature - Second Law of Thermo). All that heat must be radiated off also, otherwise the interior of the spacecraft gets overheated. The ISS has a heavy problem with this, as yet not solved to expand and increase its number of crew members. This is also why space-suits have such a large package on the back, where you would expect an oxygen bottle only, just like with divers under water. The large backpacks absorb and store the body heat of the astronauts, otherwise they would get 'boiled' in their suits.

For the same reason solar panels on spacecrafts must radiate off their 'waste heat' on the backside (only 30% of absorbed solar radiation is converted to electricity ... heating up the interior of the spacecraft after "use"). When you see artistic SF-pictures of solar panels lying on the moon ground ... they would 'evaporate' within rather short time. Not to speak of nuclear reactors as we use them on Earth, generating heat only - in a vacuum environment, they would melt down in no time! Think of this when you read about 'industries' on the Moon, like mining, steel works, etc
However, there is no physical law that forbids ("waste") heat of low temperature to be fully(!) recirculated into mechanical work, just that we as yet have not found such a technology. Being the thermo-engineer I am, I do have a theory that would allow such a technology, which I call the Compex-cycle machine, but I do not have the means to develop it. Anyway, only in space technology it would be of interest, because the powers-that-are, would for nothing in the world want to see THIS machine in your home, reducing your energy bill to almost zero ... In any case, if no such recirculation technology is developed, we will never see any high-energy projects being performed in the vacuum of space, on the Moon, hardly even on Mars.
How cold can an object in "dark" space become? Many would say 3 Kelvin, which is the "temperature" of the cosmic background radiation (actually 2.7 K). This radiation is assumed to be a remnant of the Big-Bang and its frequency corresponds with 3 Kelvin. Many think erroneously that this is the temperature of space, but that is of course not true. An object in deep, deep dark space can become colder than 3 Kelvin, but it can never become 0 Kelvin, because 0 Kelvin is not a temperature - it is the absence of it, "nothingness", a void. Matter as we know it, cannot exist at 0 Kelvin.
However, this is not agreed upon by all scientists. Google on the "Third Law of Thermodynamics" and you will find it. I personally do not agree with that "law".
Anyway, SPACE IS NOT COLD, just you know ...