The process is called fractional distillation. It works by heating up the crude oil inside a chamber to a boil (vaporizing it). Due to the fact that each component of crude oil has a different boiling point, each component of the crude oil will condense at a different height inside the chamber since the chamber gets colder the further up you go away from the heat source. Since each component condenses at different heights in the chamber, there are places to collect condensing liquid at different heights in the chamber (The heights correspond to the boiling point of each component). These collection areas will collect only the component of crude oil that condenses at that temperature. The condensing point is basically the boiling point which means the lower in the chamber that component condenses at, the higher the boiling point for that component is and therefore the heavier that component is (the heavier components get collected near the bottom of the chamber while the lighter components get collected near the top of the chamber).
I hope this helps. Let me know if anything is unclear.