In general, crude oil is refined to produce diesel and petrol.
Crude oil is made up of different types of hydrocarbons and other impurities.
To produce diesel or petrol, these hydrocarbons need to be separated by a process known as fractional distillation.
Fractional distillation is the separation of a mixture by heating into its fractions or parts. The longer the hydrocarbon chain, the higher the boiling point. Each part is captured as a vapour then recondensed.