There are three main types of fossils: impression fossils, trace fossils, and replacement fossils. This is how each type of fossils forms:
Impression fossils: When the living organism dies, either a cast or a mold is formed. In the case of a mold, mud or sediment covers the body and forms an impression of the organism. When the organism decays, the impression of the body remains. A cast works much the same, except that the cavity of the impression is filled in by minerals, forming a “replica” image of the organism.
Trace fossils: Trace fossils include any impression or other preserved sign of activity rather than the preserved remains of the body of the actual organism itself. They include footprints, dung, nests, and tooth marks, and they give hints about the behavior of ancient organisms.
Replacement fossils: These fossils are replicas of living beings—such as trees, land animals, and sea creatures—which were trapped in an ocean, lake, or pond, where the living beings were covered with silt and where oxygen was mostly excluded, leaving the body intact long enough for the fossilization to occur. As they rotted, the organic parts were replaced by hard mineral deposits. The minerals filled in the spaces and created a replacement fossil of the living being.