The oil is extracted either onshore or offshore by large oil rigs. Crude oil is transported to a refinery. The refinery turns the crude oil into gasoline. The gasoline is loaded onto tank trucks. The tank trucks go to gas stations all over the place. The gasoline is delivered to the gas station. 
How does oil get from the ground to a gas station?