Most fossils are found in sedimentary rocks, which occurs as described below:
Once a plant or animal dies, it falls to the ground and is covered by sediments. Sediments are particles that fall and settle to the bottom of a liquid (in this case a river, pond, lake, etc.). Over time, the sediments thicken and harden around the remains of the animal or plant. At this point, the remains of the animal may either dissolve or become mineralized by the sediments. If the fossil dissolves, then a mold fossil is formed (which looks like an indentation). If the remains of the organism are mineralized, then a cast fossil remains (which will be three dimensional). Over time, the land around the fossil erodes and exposes the fossil.