Fossilization
When a soft-bodied animal like a dinosaur dies, the body will decompose over time and eventually only the bones and teeth remain. If the bones are fortunate enough to be in a location where the ground is slowly sinking then layer upon layer of sediment will bury the bones deeper below the surface.
Sedimentary Rock
As the layers of sediment above the buried bones increases, so does the pressure on the layers of sediment lower down. Eventually the pressure becomes so great that it causes the layers of sediment to fuse. This is how sedimentary rock is formed. The dinosaur bones are preserved in the sedimentary rock.
Permineralisation
Permineralisation occurs when mineral rich water trickles in through the sedimentary rock and around the dinosaur bones. The minerals fill the spaces within the bone and in some instances calcium in the bones may be replaced with these minerals. The new minerals in the bone make them even harder and more likely to be preserved.