My dad and I used to do it with the tank filled with water.
There's an easier way. Run a hose from the exhaust pipe of a running engine into the tank. No heed to empty the tank either. The exhaust fumes will purge any oxygen and make combustion impossible. I once watched a welder weld on the tank of a piece of heavy equipment using that method. You can also use the same method to make a gas tank safe to weld on.