Perhaps you have pressed a favorite flower between the pages of a book. In time, the sweet petals dry out and seem to become part of the paper and you can save your pressed flower for years. Fossils are formed somewhat like this. The pressed specimen may be a leaf or the body of an animal. The pages are the rocky layers of the earth’s crust.
In the remote past, a bird fell into a swamp and the mud dried around its body. Shells on the sea floor were covered with slime, a branch was buried by a landslide. All these things were pressed like specimens between layers of earth and rock. They were preserved and became fossils.