Sedimentary rocks are the only ones that have the ability to preserve a fossil. As the years go by and more layers are added the fossil will always stay secure in the rock.
Sedimentary Rock Here's Why: Fossils also form from molds and casts. If an organism completely dissolves in sedimentary rock, it can leave an impression of its exterior in the rock, called an external mold. I got this information from http://www.livescience.com/37781-how-do-fossils