Fossil fuels are formed from:
Living organisms buried inside the Earth for millions of years
Fossil fuels such as coal and petroleum are formed by the dead remains of living organisms which were buried under the Earth crust for millions of years. Burning of wood with the limited oxygen supply would result in charcoal, which is not a fossil fuel.