The random molecular motions associated with thermal energy represent a disordered state of relatively high entropy. As a result, the second law of thermodynamics precludes converting random thermal energy into more organized energy. However, we can build heat engines that convert some random thermal energy into useful mechanical or electrical energy. The second law puts explicit limits on the efficiency of heat engines and on the ability of refrigerators to extract thermal energy to provide cooling.