How does the refrigerator or freezer work to keep things cold?

The freezer absorbs heat energy in the freezer and dumps it outside of the freezer.
The freezer absorbs heat energy in the freezer and dumps it outside of the freezer.