Here's why:
* Fossils form in sedimentary rock: Fossils are the preserved remains or traces of ancient life. They form when organisms are buried in sediment (like sand, mud, or silt) and the sediment eventually hardens into rock.
* Other rock types don't usually contain fossils: Igneous rocks (formed from cooled magma or lava) and metamorphic rocks (formed from existing rocks under heat and pressure) are generally too hot or have been subjected to conditions that would destroy fossils.
So, the presence of fossils is a strong indicator that you're looking at sedimentary rock.