The study of how energy is distributed under the influence of entropy. For chemists, the thermodynamics of a reaction specifically refers to the study of the relative energy levels of reactants and products.
This study observes how heat and work relate to each other both in the changes of state and in chemical reactions. It includes rules and laws that explain how heat and work is done. Explaining which processes can happen spontaneously and which need to be ignited.