Because activated carbon has high requirements for water pretreatment, and the price of activated carbon is expensive, in wastewater treatment, activated carbon is mainly used to remove trace pollutants in wastewater to achieve the purpose of deep purification. The oily wastewater from the refinery is firstly treated by oil separation, air flotation and biological treatment, and then advanced treatment by sand filtration and activated carbon filtration. The phenol content of wastewater decreased from 0.1 mg/L (after biological treatment) to 0.005 mg/L, the cyanide content decreased from 0.19 mg/L to 0.048 mg/L, and the COD decreased from 85 mg/L to 18 mg/L.