When animals and plants die, their bodies fall into sediments. Some of these decays while some become part of fossilized rocks. Rock layers build up and the rock becomes a solid. The minerals in the rock replace the soft parts in parts of dead bodies. This takes place over millions of years. The remains of living organisms that have changed to stone are fossils.