system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do refrigerators work?
gpt
Well, son, say you have a balloon. When you squeeze the balloon really tight, you force heat out, but when you let the balloon open up again, it sucks heat back up. If you suck heat out of one area and move it to another area, you make that area colder. In a refrigerator, there is basically a balloon of air that sucks up heat from the inside and squeezes it out on the outside.

The amount of heat in the balloon can be explained by the equation PV = nRT. n (basically the amount of air in the balloon) and R (a constant) don't change in this case, so T (temperature) is given by multiplying P (pressure) by V (volume). When you increase pressure or volume, temperature increases, and if you decrease pressure or volume, temperature decreases. So to get heat out of the refrigerator, we want to

1. Decrease pressure in our balloon (while keeping volume the same) by using a pump of some sort
2. Bring our balloon inside the refrigerator
3. Suck the extra heat into the balloon by allowing the pressure to increase (if the balloon's pressure goes up, it's temperature goes up, so the temperature of the area around it goes down)
4. Bring the balloon outside the refrigerator
5. Decrease the volume of the balloon, squeezing the heat out (if the volume goes down, the heat inside goes down, so the heat outside goes up)
6. Repeat this until our refrigerator is cold enough

One thing to think about is that the point of this cycle is to move energy (in the form of heat) out of the refrigerator. But because this is a closed system, we have to add energy (in the form of electricity) that is roughly equal (minus mechanical inefficiency) to the energy being sucked out.

Incidentally, the refrigerator doesn't use air or a balloon, but instead a fluid refrigerant and a series of tubes. Refrigerants are a lot better at sucking up and squeezing out heat than air is, but unfortunately, a lot of the refrigerants that people used to use are bad for the ozone layer. So when you grow up and buy your own house, you should try to look for appliances that are good for the environment, and dispose of old appliances safely.