The layers of sediment the fossils were found in can determine how old the rocks are once the age of the fossils are known, because the earth burying the fossil is almost like a fossil itself. It preserves the age of when it was buried in layers.
Hope this helps!! <3