Fossils are preserved remains or traces of dead animals or other organisms. Fossil formation begins with the death of a creature. When the dead animal settles at the bottom, the first reaction is the decaying of the fleshy parts. As a next step, the sediments cover the remains of the dead animal. When water seeps through the sediments, the molecules of the animals get converted into silica on a gradual basis.
As the sediment piles higher, the pressure causes the sediments to become hardened rock. Sandstone is formed by sand sediments. Clay sediments turn shale, and shell sediments are converted into limestone. With the seeping in of the groundwater, the sedimentary rock enables the formation of the foils in either of the two ways. In some instances, minerals get settled in all empty parts of the dead creature and turn into crystals.
These crystals turn the remains to get hardened along with the sedimentary rock which is encased in. This process is called permineralization. In other cases, the minerals contained in the remains are replaced by the minerals in the groundwater seeping into the remains. This process completely replaces the hard parts of the remains with minerals over a period of time. This process is known as a replacement. Impressions and molds are the other types of fossils. Such types of fossils are made when parts like shells are filled with sediments that get hardened, and the actual shell gets dissolved without any remains leaving the sediment as mold.