There can be different causes, and different causes require different treatment.
Bacteria – A bacteria attack could cause inflammation at the epithelium of the sac, making the sac walls too thick for proper gas diffusion. Thus, the fish is now stuck at certain buoyancy, making swimming very difficult.
Diet – Feeding low-quality food that soaks up water and expand inside the fish can cause food impactions.
First, tend to your water’s quality. Making sure the water quality is top-notch allows us to assume that it is not a bacteria attack. But if you strongly suspect it to be the cause, then do visit your local pet shop for an appropriate medication. For treatment towards the other forms of cause, first stop feeding the sick fishes for a few days. Fishes can go without food for up to 10 days, so stopping a few days is really all right. After the few days, if the fishes do not get better, try feeding peas. Yes, peas that we eat. This treatment is being recommended by many and is well worth a try. The peas will supposedly encourage the destruction of impactions.