Most of what we eat is made of five different types of food molecules: fats, carbohydrates, vitamins, minerals, and proteins. When we apply heat from a stove or an oven during cooking, the extra energy provided by the heat causes the food molecules to vibrate. These vibrations can cause the food molecules to change their shape.
For example, a solid block of butter, which is fat, melts when heated. Table sugar, which is a carbohydrate, caramelizes when heated.
Similarly, protein molecules are usually curled up like a knot, held together by tiny bonds. When heat is applied the bonds start breaking, unable to hold their shape, and the protein molecules start to uncoil into straight chains. This process is called denaturing.