Minerals are the building blocks of rocks and come in over 3,500 varieties. They form rocks through the rock cycle of igneous, sedimentary, and metamorphic processes. Igneous rocks form from cooling magma, sedimentary rocks form through the compaction and cementation of sediments, and metamorphic rocks form from existing rocks undergoing heat and pressure.