Here's why:
* Sedimentary rocks form from layers of sediment: These layers are formed by the accumulation of materials like sand, silt, mud, and organic matter over time.
* Fossils are preserved in sediment: When an organism dies, its remains can become buried by sediment. Over millions of years, the sediment compacts and hardens, forming sedimentary rock. The organism's remains are preserved within the rock as fossils.
Other types of rocks, like igneous and metamorphic rocks, are formed under high heat and pressure, which would destroy any fossils.