Sedimentary rocks form through the sedimentation and accumulation of minerals and particles. Metamorphic rocks form when existing rock types are transformed by heat and pressure. Igneous rocks form when magma cools and solidifies, either below the surface as intrusive rocks or above as extrusive rocks.