Since the components has different boiling points, they're not chemically combined together. They can be separated by physics methods.
One method that suits this case is using fractional distillation.
The petroleum can be cooled down into liquid, then, it will be slowly heat up. When we heat it up, since different components has different boiling points, certain components boils off first, instead of all liquid. Therefore we can catch different components when they boils off one by one once they reach the boiling points.
However, note that this is not simple and has to be done in fractional distillation plants in large areas.