When fish swim belly up, you can suspect swim bladder problems. This could mean that the fish has reached a point where he is too weak to control the swim bladder or that the organ is physically damaged. There are several common causes of this problem, and several solutions to it.
Some fish, like certain goldfish breeds and cichlid hybrids, have rounded body shapes not found in the original wild types of these species. These fish are more prone to issues with their swim bladders. For such fish, you often cannot do much. However, in some cases the problem boils down to constipation; unusual body shapes makes it easier for a full digestive tract to disrupt the swim bladder. In this case, treat the problem as you would constipation.
Fish can suffer physical damage to their swim bladders in a number of ways: shock from introductions to a new aquarium, fights with other fish and bacterial infection of the organ are among them. In most of these cases, the swim bladder will heal and the fish will be fine once you remove the issue. Always introduce fish by floating their bags, then mixing some water from the main aquarium into their bag slowly. This avoids temperature and chemical shock. Separate fish who are fighting with each other to separate aquariums if necessary. If you see no evidence of either cause, it could be an infection. Treat the fish with antibiotics. Since the infections that cause swim bladder disease are not particularly infectious, you may want to treat the affected fish in a quarantine tank so you don't have to dose the entire main aquarium with antibiotics.
Only one cause of swim bladder disease typically troubles more than a single fish in a tank at once: water chemistry. If you have more than one fish in the tank swimming belly up, there's a good chance something has gone wrong with the water chemistry. Immediately test your ammonia and nitrite levels, and check the temperature. Your ideal readings for ammonia and nitrite are 0 ppm. Keep up on your water changes and dechlorinate fresh aquarium water before adding it to the tank.
Some fish are more vulnerable to constipation than others, but in theory, any fish can develop constipation. This can lead to issues with the swim bladder, which in turn can cause swimming belly up. To avoid this, soak larger dried foods like pellets and tablets before feeding. Also, try feeding daphnia, brine shrimp or a skinned pea. These foods have a laxative effect on fish. Also, skip feeding your fish one day per week to reduce the chance of constipation and swim bladder issues.