Three types of fossil fuels are: Coal, natural gas and oil.
Coal is made from millions of years of decaying land vegetation. Over the years the layers are heated and compressed, eventually becoming coal.
Oil comes from marine microorganism remains resting on the seafloor. After millions of years it finds itself in rock and sediment, where it can be trapped in small spaces.
Natural gas is also made from marine microorganisms. Natural gas mainly consist of methane and is often found deep down in the earth, compressed in small amounts hidden in the rock.