Cut the power to the pressure tank. Check the valve to see if it is broken or leaks. If so, change it. If these problems aren’t fixed, the pump will simply become waterlogged again.
Open the faucet closest to the tank, ideally one that is close to the ground. Let the water drain out until it is only trickling out of the faucet. This will empty out most of the water in the pressure tank.
Bring air into the tank, either by taking out a fitting or plug to let air seep in on its own, or use an air compressor to pump air into the tank through the side or bottom. The air will help remove most of the water out of the tank. If the pump motor is in the well, you can remove all the water from the tank. If you have a jet pump, you should leave half the water in the tank to use for priming the pump. Fill up several buckets with water to add to the pump when you do not have enough water to prime it.
Turn off the faucet and stop adding air to the tank. Open the valve between the tank and pump to keep the pump running, but do not open the valve so much that the pressure drops below 20 pounds until the tank completely fills up.