In geology, rocks are classified into three main types: igneous, formed from cooled magma or lava; sedimentary, created from the accumulation of sediments; and metamorphic, which are altered by pressure and heat from existing rocks.