Popeye is a bacterial infection generally caused by poor water quality, although it can also be caused by an eye injury that becomes infected. The main symptom of Popeye is that the eye starts protruding from the head, and if left long enough without treatment, the eye can actually fall out. Popeye is generally not fatal (unless it is not treated and the infection is allowed to spread), and with proper care, the eye will sink back into its socket when cured.
If the fish is in a community tank, isolate him in his own container. This is not because popeye is contagious, but rather for the affected fish’s safety and so that it can be medicated and the water quality monitored. If the fish is already isolated, do a water change immediately upon noticing the condition.
Because popeye is a bacterial infection, you’ll want to treat it with a broad spectrum antibiotic. Recommended medications are: Ampicilex (Aquatronics), Penicillin, Maracyn 2, and Amoxycillin. Follow directions on the medication you choose, but keep the fish’s water absolutely sparkling clean during treatment (and afterwards, of course).
Popeye is practically the easiest thing in the world to prevent simply by keeping the betta’s water clean. Adding a teaspoon of dissolved aquarium or rock salt per gallon can also help prevent Popeye, but clean water is absolutely crucial. Popeye, along with fin rot, is a flashing neon sign that you are not keeping your tanks/jars as clean as they should be. If your fish ends up coming down with popeye, you need to start devoting more time to your tank maintenance.