i clean the gun as i would after firing, cleaning out all the carbon and old oil and grease. depending on how bad it is , a de-greaser needs to be used to get into all the crevices. Then good old dish soap and water. i use a small and large brush to scrub the firearm. rinse and repeat the dish soap a few times until a water bead test shows no oil.
Dry with a hair drier and get it coated before it rusts. this is what i do before parkerizing a gun, so it should work well for paint.