The first law of thermodynamics states that the total energy of a closed system remains constant regardless of how it is affected by work or other processes. In other words, when you add heat to a closed system, the total energy will stay the same. But, when you remove heat from a closed system, the total energy will decrease until it reaches zero.
For example, if you have water at 120 degrees Fahrenheit, and you add heat to it (raise its temperature), then the total energy does not change. If you take away heat from it (lower its temperature), then the total energy decreases until it reaches zero, or, in this case, 0 degrees Fahrenheit.