If you are talking about separation of crude oil and bottom sediment plus water (BS&W) for crude oil storage tanks in an oil refinery, there is no economically practical way to achieve a perfect separation.
If you are talking about separating and removing oil from the wastewater entering the a refinery wastewater treatment unit, then most refineries use either of the following:
(1) An API gravimetric separator followed by dissolved air flotation DAF.
(2) A parallel plate interceptor followed by dissolved air flotation DAF.
Either of those usually usually results in reducing the oil content of the wastewater down to 5 to 10 ppm which is not a perfect separation but good enough to enter the next step in your wastewater treatment unit.
If you are talking about separating crude oil and water on a laboratory scale, then one of the other responses has suggested centrifuging or or distillation ... although I'm not sure they would provide a perfect separation.