Rocks are formed when magma or molten rock from deep inside cools. Sometimes magma is forced to the surface of the earth by pressure inside.
Rocks are formed near the surface of the earth wind, water and weather. Erosion causes little bits of sand, or soil, on pieces of rocks and shell to move over the earth, they finally settle together and harden in layers.
Rocks are formed when extreme heat, pressure and major shifting of the earth cause changes in igneous or sedimentary rock. They often look like they have been folded or squeezed.