Fossil fuels are formed when the animal or plant buried inside the earth for many years under immense pressure. As the sun is the source of energy that helps plants and animals to survive which are responsible for the formation of fuel like methane, petroleum etc. Therefore sun is the ultimate source of energy of fossil fuels.