Thermal energy is produced by work or heat. When we use a hand pump to inflate a bicycle tire, the pump becomes heated. In this case, thermal energy is produced through the transfer of mechanical energy.