Depends on the earned materials. If a foam rubber type, take off the headphones first. Use a very gentle cleaning with some unscented or plain soap like dish soap, and air dry only.
If a fabric or synthetic leather cover, that is completely different. There are spray cleaners for those, but you should tape over the holes leading to the speaker drivers before squirting anything.
My 1970s Sennheiser 400 wonderful lightweight phones are on their 3rd set of foam rubber pads. Not cleaning but replacing. And my ears are normal, not oily.