AC as refrigerant, not coolant. Although that might be semantics.
AC is a type of heat pump. You are moving heat from inside to outside. The physics behind a heat pump, is fairly simple. There are three principles to work with.
Take a gas, compress it, and it gets super hot.
Take a compressed gas, let it rapidly expand, and it gets super cold
Different temperature gases move from hot to cold
Let's focus on AC since most folks are used to that concept. In an AC, you have a closed loop of refrigerant. Outside, there is a compressor that compresses the gas, which makes it very hot. The gas is pushed through a radiator with a fan pulling air through it. Since hot moves to cold, the heat trapped in the gas moves to the outside air, and the gas is slightly cooled. (As long as the gas is hotter than outside).
Inside, there is an expansion valve that lets the gas rapdly expand, making it super cold. It is pumped through a radiator that has inside air blowing over it with a fan. Since hot moves to cold, the heat in the inside air moves to the cold gas, cooling the inside air. (As long as the gas is cooler than the inside temperature). It is then pumped outside to start the loop again.
So, inside gets cooler while the heat is moved outside. The physics also establishes the limits of the heat exchange. You will only grab heat from inside if the expansion makes the gas colder than the air inside. Typically it expands to around 0 degrees. Likewise, it will dump the heat outside if the gas is hotter than outside air. The compressor typically makes it 130 to 140 degrees (temps vary depending on many factors).
To use a heat pump for heating rather than cooling, reverse the process. Pick up the heat from outside and dump it inside. This will work as long as outside is warmer than the expanded gas (0 degrees or so). Although you can get some that go to around -20.
it is, (although the design is slightly different, you couldn't just run the motor on an AC backwards).
Heat pumps are better for the environment because it's (usually) more energy efficient to extract existing heat than create it. Heat-pumps get more heat per unit energy spent than resistive heat (like electric radiators) because they're not creating the heat, they're just moving it.
Natural gas still kind of wins out, but that has the issue of constantly needing more natural gas.
The most environmentally friendly play would be, if you were like on a space station or something: Imeaditley stop producing more natrual gas, use up whatevers left in reserves, then install heat pumps. But of course that's not how things work so we're transitioning now.
edit: re: AC not being good for the environment. AC isn't the problem, just the power is. So it's just seen as a luxury as opposed to necessity, although obviously that's starting to change.
And now you've stumbled upon the debate that us air conditioning and refrigeration mechanics are all participating in. Refrigerants right now have some sort of danger.
R-22 has an ozone depletion potential. It has clhlorine atoms that break up ozone in the atmosphere, and it's been discontinued in 2020.
R-410A has flourine atoms, so has no ozone depletion potential but has a global warming potential, like CO2. It's the current refrigarant for air conditioners and heat pumps, next to be phased out when we find a better replacement.
Ammonia is natural and not harmful for the environment, but flammable and toxic in high concentrations. Lucky for you, most air conditioning or residential/commercial refrigeration systems don't use it, it's only large scale industrial refrigaration, like fisheries, ice cream and yogurt factories, etc.
Some say the hydro companies are pushing heat pumps to make more money. They also require more maintenance than a furnace, which also cost $$. Change your filters, and have your electrical components checked at least once per year and your system be happier in the long run and you'll save on break downs and repairs.
Me, I just try to do a good job, practice good workmanship to make sure my installs and the equioment I maintain don't leak or break. That's how I'm doing my part for the planet
We're constantly trying to do better and be better, it's just a long process.
As others have said yes, thats an air conditioner, but to expand: that's why the outside of an air conditioner (either one of the big ground mounted ones outside or the window ones) gets hot while it's operating. You could technically just mount your window AC backwards.
To expand further, that's part of why heat-pumps weren't in expanded use for a while. In the summer you're extracting hot from the room and putting the hot outside, so your heat exchanger is hot. But in the winter when you're extracting heat from outside and putting it inside, you make the heat exchanger outside more cold. So cold, infact, that icing becomes an issue, and when it ices over it's less good at extracting heat. There are some neat tricks modern heat-pumps use to avoid icing over their outside heat exchanger (including running backwards to extract heat from inside and heat up the coils for a bit).
It's also why you saw early adoption of heat-pumps in areas where people might need both heating and cooling, but it didn't get bitter cold.
Another way this is avoided in some cases is to simply bury the heat exchanger to a depth below the frost line, where it can't freeze. Then you can add/extract as much heat as you want. That's geothermal heating/cooling. In some cases geothermal may be passive (ie: you're just circulating a fluid and temperature you get is what you get), but it's real strength is as a heat exchanger.
In fact, with the ground being able to accept/source as much heat as you want, you could actually place the "topside" exchanger in an area where you weren't trying to control the temp, and take advantage of the temperature difference to create power. Thats geothermal power. However, the efficiency and payback of that is based on the difference in temperature, which is why you only see it in instances where there's some natural source of higher temp heat underground. I suppose geothermal power would work just as well with a natural source of low temp cold (like the opposite of lava), but I'm hard pressed to imagine what that would be.