They relax their sphincter muscles in the pneumatic duct that connects their gut with their gas bladder. By doing that, the air will be allowed to empty out of the bladder. This reflex action is sometimes called "gas-spitting".
The swim bladder, gas bladder, fish maw or air bladder is an internal gas-filled organ that contributes to the ability of a fish to control its buoyancy, and thus to stay at the current water depth...
The air bladder enables 'those fish that have them' to achieve a neutral bouyance, that is they can remain motionless in one place, or they can sink or rise however they please. Fish that don't have...
As water becomes deeper, its pressure increases. Fish like to swim level and need a way to stay at the same level. By putting air into their swim bladders, they decrease its pressure and rise higher....