When mountains are first formed, they are tall and jagged like the Rockies. Over time, millions of years, mountains become old.
When mountains get old, they are rounded and much lower. What happens in the meantime is that lots of rock gets worn away due to erosion. In a rain, freeze/thaw cycle, wind and running water cause the big mountains to crumble a little bit at a time. Eventually most of the broken bits of the rock end up in the streams & rivers that flow down from the mountains. These little bits of rock and sand are called sediments. When the water slows down enough, these sediments settle to the bottom of the lake or oceans they run into. Over many years, layers of different rock bits settle at the bottom of lakes and oceans. Think of each layer as a page in a book. One piece of paper is not heavy. But a stack of telephone books is very heavy and would squash anything that was underneath. Over time the layers of sand and mud at the bottom of lakes and oceans turned into rocks. These are called sedimentary rocks. Some examples of sedimentary rocks are sandstone and shale. Sedimentary rocks often have fossils in them.
Plants and animals that have died get covered up by new layers of sediment and are turned into stone. Most of the fossils we find are of plants and animals that lived in the sea. They just settled to the bottom. Other plants and animals died in swamps, marshes or at the edge of lakes. They were covered with sediments when the lake got bigger. When large amounts of plants are deposited in sedimentary rocks, then they turn into carbon. This gives us our fossil fuels, coal, oil, natural gas and petroleum.