Oil and Gas are used to produce electrical energy, mechanical energy, and heat energy. Oil and gas are pumped from wells deep in the ground or even under the ocean. They are then sent through pipelines to be refined or cleaned. A sedimentary rock called shale may also contain oil. When oil-containing shale is heated to high temperatures, the oil can be extracted.