Here's my process, garnered from this forum.
I'm sure it's overkill and I should probably just purge with fermentation gas... but nonetheless, this is my process.
Take the gas dip tube out and cut it short so it's flush on the inside of the keg when re-inserted. You want to feel no edge or lip.
1. Place a bottling gallon bucket full of distilled water Starsan on table. ~6.5 gallons
2. Place the keg on floor
3. Drain from the bucket to the keg beer out post with the displaced air going out the gas in port into a better bottle or some other larger container (not a cup).
4. Once star san starts coming out into the better bottle, I tip the keg so the gas post is at the highest point and rock the keg back and forth for a bit.
5. Once I get all the last bits of foam and air out, you should see a steady solid stream of starsan flowing, take off the gas disconnect. Then take off the beer disconnect.
6. Move the Starsan bucket to floor
7. Hook up CO2 to the gas in on the keg, and turn on C02. Then put the liquid line into the Starsan bucket and connect liquid ball lock. Push Starsan back into the bucket (I reuse Starsan for a long time)
8. Once C02 starts blowing out the liquid line, I disconnect liquid line, let some pressure build in the keg, then disconnect the gas and let the keg sit for an hour or so.
9. I'll pop a liquid ball lock disconnect on after the hour passes and blow all the Starsan out that settles to the bottom of the keg, still leaving pressure in the keg.
10. Then I invert the keg, and lean it at an angle against something, so the gas post is the lowest spot on the keg.
11. I let the keg sit overnight in that position.
12. After the wait,I pick up the keg, maintaining the same position (gas post at the lowest point) the whole time, and pop a gas disconnect on quickly to blow out any remaining Starsan. This is arguably the most annoying part of the whole process. I've had thoughts about building a keg holder to position the keg at the right angle, and maybe even up high, so you can just pop on the gas disconnect easy without picking up the keg.