The thermal energy of an object is the energy contained in the motion and vibration of its molecules. Thermal energy is measured through temperature.
Temperature is a direct measurement of thermal energy, meaning that the hotter an object is, the more thermal energy it has. Heat is a measure of how much thermal energy is transferred between two systems.
It is easy to turn mechanical energy into thermal energy, for example using friction. It's also possible to turn thermal energy into mechanical energy by using a heat engine, but there will always be waste heat with this method.
The latent heat of a substance is the heat required for an object to change states, also called a phase change. Generally speaking, values for latent heats are much higher than those for specific heat. This is also referred to as enthalpy. To learn more about enthalpy and latent heat please see hyperphysics.
The latent heat of fusion is the heat required for an object to go from the solid state to the liquid state, or vice versa. Because its value is generally much higher than specific heat, it allows you to keep a beverage cold for much longer by adding ice than simply putting in a cold liquid to begin with. It's also why frozen meat takes a long time to thaw, but once its thawed, it heats up quickly.
Ice and water have enormous latent heats associated with them, which is why snow takes so long to melt and water is used for cooking. This is also important in keeping our planet comfortable to live on, and provides a fair amount of resistance to climate change.
The latent heat of vaporization is the thermal energy required for a liquid to vaporize or condense. Water has a high latent heat of vaporization, which is why steam burns are so dangerous. The steam is above 100°C, so it transfers the energy from its temperature, down to 100°C, then the heat from vaporization, which is much larger, and then it transfers the heat of the boiling water that remains.
The University of Colorado has graciously allowed us to use the following PhET simulation. Explore the simulation below to get a physical intuition of how friction can increase thermal energy and turn macroscopic motion into microscopic.