Over millions of years, organic matter, such as the remains of plants and animals, trapped between the sedimentary layers, gets converted into fossil fuels, namely, coal, petroleum and natural gas. Fossils and fossil fuels usually form in sedimentary rocks.