A rock is defined as any solid mass of minerals or mineral-like matter that occurs naturally. Minerals can be found naturally in rocks, or can form from the weathering and breakdown of existing rocks. There are three main types of rocks: igneous, sedimentary, and metamorphic. Igneous rocks form from the cooling of magma either underground as intrusive rocks or on the surface as extrusive rocks. Sedimentary rocks form by the compaction or cementation of sediments such as sand, gravel and minerals. Metamorphic rocks form from the alteration of existing rocks through heat, pressure and chemical processes within the Earth's crust.