Aristotle used the word energy (energeia) in the 4th century BCE. Energeia was a qualitative concept which included motion of all kinds, including pleasure and happiness. This vibrant quality would become treated qualitatively as physics evolved into a mathematical discipline.
In 1676 German philosopher and mathematician Gottfried Leibniz began to develop the idea that a system had a vis viva: a “living force”. At the time vis viva seemed opposed to the theory of conservation of momentum advocated by Isaac Newton and René Descrates. In the 1730s French physicist, mathematician, and natural philosopher Émilie du Châtelet understood that Leibniz was referring to conservation of kinetic energy, which is distinct from conservation of momentum. The prior opposition to vis viva had arisen because kinetic energy was not properly understood.
Thomas Young first used the term energy in the modern sense in 1807, incorporating vis viva; this after vis viva bested the caloric theory as better explaining the potential of heat to generate motion. In 1845 English physicist James Prescott Joule discovered the link between mechanical work and the generation of heat.
Mathematical ponderings about heat led to laws of thermodynamics, based upon the core assumption that energy in a closed system is, as an aggregate, a fixed quantity. Our universe has been shown to not be a closed system energetically. Hence, these ‘laws’, while mathematically neat, are fictional.