Sedimentary rocks are formed from the accumulation and cementation of sediments, which can include the remains of plants, animals, and other microorganisms. These remains can be preserved as fossils within the rock layers. Igneous rocks are formed from the cooling and solidification of magma or lava, and metamorphic rocks are formed from existing rocks altered by heat and pressure, processes that usually destroy fossils.