Rocks can change from one type to another through various geological processes. Sedimentary rocks form through the compaction and cementation of sediments like sand and clay. Metamorphic rocks form from changes to other rocks through heat and pressure in the Earth. Igneous rocks form when magma or lava cools and solidifies. Rocks continuously cycle between these three types as they are weathered, eroded, deposited, lithified, and altered by heat and pressure in an endless transformation.