We're already familiar with the first law of thermodynamics, even if we are not aware of it. The first law of thermodynamics is simply the law of conservation of energy, reworded for systems that involve thermodynamics. It says:
"In a thermodynamic process, the increment in the internal energy of a system is equal to the difference between the increment of heat accumulated by the system and the increment of work done by it."
This is merely saying that, when energy seems to be lost during work, it is merely converted into heat. This in turn is important to realize because it means that the energy within the universe is a constant--energy cannot be created or destroyed, merely converted from one form to another.
It is also important to realize that, when systems are in thermal equilibrium, that there is no net heat transfer. (Thermal equilibrium merely means that two systems are at the same temperature.)
There are two different types of reactions that can take place--an endothermic reaction and an exothermic reaction. In an endothermic reaction, heat is added to the system, and in an exothermic reaction, heat is taken away from the system.
Now that we have the basics of thermodynamics, we can look at how they apply to a chemical system. A common example of this is considering what happens in a piston chamber. Heat is added to the system, causing the gas within the chamber to expand. This pushes the piston down, causing work to be done. Here, we can see that, when heat was added to a system, the internal energy of the system increased--because both the heat and the work done increased.
Another example of this can be found in my acquaintance Damien's experiment. Basically, they created a super-saturated solution heated to the boiling point, then cooled it and allowed it to crystallize. As it did this, the energy from the motion that was within the liquid was released as heat. Again, we can see that the energy did not disappear--it was converted into heat.