Work and heat are a means of transferring energy. When energy is in transit between a system and its surroundings or another system, the total amount of energy transferred by both work and heat is conserved. In this case, work and heat are path-dependent.