The age they were formed is called the Carboniferous period, getting its name from carbon the basic element in coal and other fossil fuels. Fossil fuels are made up of decomposed plant and animal matter. Plants change energy they receive from the sun into stored energy. This energy is food used by the plant. This is called photosynthesis.
Animals eat plants to make energy.
And people eat animals and plants to get energy to do work. When plants and other ancient creatures died, they decomposed and became buried, layer upon layer under the ground. It took millions of years to form these layers into a hard, black colored rock-like substance called coal, a thick liquid called oil or petroleum, and natural gas. Fossil fuels can be found under the earth in many locations around the country. In California, we have oil and natural gas resources.