Fossils usually only form in sedimentary rock. Sediments have to accumulate over the organism in order to preserve it. This could be a rapid burial, such as a volcanic eruption or mudslide, it could be sap from a tree oozing over an insect, or simply a slow sediment accumulation on the bottom of a lake.