When the organism dies, its soft parts will either be eaten by scavengers or be decayed by microbial action.
The next stage in fossilization is for their remains to be buried in sediment at the bottom of a water column.
Once an organism's remains have been buried in the sediment, they can remain there, potentially, for an indefinitely long period of time.
As new sediment piles on top of older sediment, the lower sediments are compacted: water is squeezed out and the sedimentary particles forced closer together. The fossil hard parts may be destroyed or deformed in the process.
As the sediments compact, they are gradually turned into sedimentary rock. They may subsequently be moved up, down, or around the globe by tectonic movement, and can be re-exposed in a terrestrial area.