Rocks are naturally occurring solid aggregates of one or more minerals or mineraloids. Geologically, they are classified into three main types based on their formation process: igneous, sedimentary, and metamorphic. Igneous rocks solidify directly from the cooling and crystallization of magma or lava. Sedimentary rocks are formed from the accumulation and cementation of fragments of other rocks, organic matter, or chemical precipitates at the Earth's surface. Metamorphic rocks originate when pre-existing rocks are subjected to intense heat and pressure, causing substantial physical and chemical transformations without completely melting. The study of rock composition, structure, and formation is central to understanding the history and processes of the planet's crust.