Rocks are generally categorized into three main types based on how they are formed:Igneous Rocks: Formed from the cooling and solidification of magma or lava. Examples include granite, basalt, and obsidian.Sedimentary Rocks: Formed from the deposition and solidification of sediment, which can include minerals, organic matter, and other materials. Examples include limestone, sandstone, and shale.Metamorphic Rocks: Formed from the alteration of existing rock types (igneous, sedimentary, or other metamorphic rocks) due to high heat, pressure, or chemical processes. Examples include marble (from limestone) and slate (from shale).