Fossils are organic products which are conserved in the Earth's crust. This means that the fossil is usually formed on or under the Earth's surface or under the water. In other words in the biosphere (think about the biosphere limits). Then this organic material is covered by debris and etc. and becomes the fossil material. The sedimentary rocks are the one type which can contain fossils because these rocks are formed on the Earth surface, under the water etc. In other words, the biosphere can only interact with the sediments.