This is straight from a helpful website:
If the cause of the fin rot is related to tank conditions, or even if you're not sure (since poor water conditions are the leading cause of fin rot), correct the water conditions first, as well as checking tank conditions. Remove the fish to a bowl of tank water while cleaning the water in the aquarium or usual bowl. #*Check the pH level. Gradually correct this if necessary.
Clean the gravel well and suck up all detritus.
If you do not already use it, establish moderate use of aquarium salt. (Consulting your LFS [Local Fish Store] is a good idea before many of these steps if you are unsure.)
Change the water and clean the bowl or aquarium.
You might consider treating the tank or bowl with a proprietary bactericide such as Myxazin, Melafix or gentian violet. If so, be sure to follow the instructions accompanying the product. Warning: Try not to treat your Betta with Melafix or Pimafix as these can lead to suffocation, the medicine will eventually coat their labyrinth organ which prevents breathing.
Keep fin rot at bay. Once you've treated the fish for fin rot, it's important to keep it at bay for the future. Ensure that the aquarium is properly set up and that the water is kept clean. Check that the filter is running properly and clean the pump and filter regularly.
Maintain a stable water temperature and good water quality.
Feed your fish a nutritious diet in the correct amounts (overfeeding is one of the biggest causes of poor water quality) for the fish species.
Avoid overcrowding or adding aggressors to the tank.
Keep a regular watch on any signs of fin rot. The earlier you catch it, the better for the fish.