system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does a machine “make something cold”

I understand the highschool basics of the physics behind energy and heat, so the concept of a machine turning electrical energy into heat is easy to wrap my mind around. The idea of “something making something cold” was explained to me as an energy deficit being fixed, like if you put ice into water, the ice takes the heat and energy out of the water until the ice turns into water also. How does something like a freezer do this to the air inside? How does a machine receive energy to then take that energy away?
gpt
A freezer is effectively heating up the outside air with the heat that exists in the freezer by absorbing and concentrating and moving that heat around via thermodynamics and fluids under different states and pressures.  Basically, the most basic principle is that for a change of state to occur requires a lot more energy than simply raising its temperature.  So as a liquid changes to a gas, it must absorb a lot more energy than simply warming up the liquid.  Now, take a particular substance that changes from liquid to gas at a convenient temperature and pressure range for your application, and squeeze it (in liquid form) into a low-pressure space where it is forced to become a gas because of the pressure.  Changing to a gas requires a lot of energy, so it absorbs all the heat around it to do so.  Now as a hot gas it can move to a different location where it is cooled down and becomes a liquid again. This is called the refrigeration cycle. And it’s how air conditioners and freezers work.