Rocks are classified based on how they form. The three main types are igneous, sedimentary, and metamorphic. Igneous rocks form from the cooling and solidification of molten rock, either below the surface as intrusions or above the surface as extrusions. Texture and mineral composition are used to classify igneous rocks. Slow cooling forms large crystals while fast cooling forms small or no crystals. Sedimentary rocks form from the compaction or cementation of sediments. Metamorphic rocks form from changes to existing rocks via heat, pressure, and chemical reactions in the Earth.