Igneous rocks form from the crystallization of magma. There are two main types - extrusive rocks that cool quickly at the surface, and intrusive rocks that cool slowly underground. Sedimentary rocks form through the lithification of sediments. Sediments are produced through weathering and erosion, transported, deposited, and cemented together over time under pressure. Metamorphic rocks form when rocks are subjected to high temperatures and pressures, causing their mineral composition and structure to change without melting. The rock cycle shows how rocks continuously transform between igneous, sedimentary and metamorphic types through geological processes.