Crude oil, coal and gas are fossil fuels. They were formed over millions of years, from the remains of dead organisms:
Fossil fuels are non-renewable. They took a very long time to form and we are using them up faster than they can be replaced - once they have all been used up, they cannot be replaced. Fossil fuels are also finite resources. They are no longer being made or are being made extremely slowly.
Millions of years ago, huge numbers of microscopic animals and plants - plankton - died and fell to the bottom of the sea. Their remains were covered by mud.
As the mud sediment was buried by more sediment, it started to change into rock as the temperature and pressure increased. The plant and animal remains were altered chemically by this process, and slowly changed into crude oil and natural gas. The slideshow describes what happened and how we get oil from the ground today:
The oil moved upwards through the spaces in permeable rock. It became trapped if it reached impermeable rock. Oil companies can drill down through the impermeable rocks to get it out. They are then able to turn it into products we can use, such as petrol and diesel.