You don't understand the process of sedimentary rock, you don't understand the process of fossilization and you don't understand the process of dating method of the rocks & fossils.
What exhemist and Astrophile have explained to you, are correct:
The sediments that buried plants and animals, are either sand or mud, or both mixture of both sand & mud, but these sediments don’t turn into rocks immediately.
The transformation of sediments into sedimentary rocks will vary how long it will take, depending on the numbers of conditions, eg how many other different layers of sediments burying on top of the layer where the bodies or plants, how much of the original layer of the sediments are compacted, etc.
It is all the silicate minerals in the sediments that cause sediments to crystallize and solidify.
The 3 most silicate minerals are quartz, feldspar and mica.
So if bodies and plants were buried in layer of sand, then quartz would be the primary mineral to cause the sediments of sand to eventually turn into sandstone.
If mud was the sediments, then clay minerals plus quartz, will turn the sediments into mudrocks. There are number of different types of mudrocks, eg claystone, siltstone, slate, shale, etc.
Now most of description referred to how sediments turn into rocks, and less about organisms would turn into fossils. Those minerals I have mentioned play essential roles in fossilization. So if you want to know more about fossilization, then my reply/post would be lot longer.
If you really to know more about sedimentary rocks, then you really should ask qualified geologists, like
@shunyadragon, for instance. shunyadragon is really a geologist, so he will be the one who would really know the process of how sediments would or could turn into rocks.
I did learn geology during my civil engineering course, but I am not a qualified geologist.
Ask shunyadragon if you want to understand the process of sedimentary rocks.