Rocks are solid mixtures of minerals that form in three main ways: igneous, sedimentary, and metamorphic. Igneous rocks form from the cooling of magma or lava. Sedimentary rocks form through the compaction and cementation of sediments. Metamorphic rocks form from changes to existing rocks through heat, pressure, or both. Rocks are classified based on their composition, texture, and formation process. They have many important uses for tools, buildings, and helping scientists understand the past.