I found this info. on Healthy Betta for treating internal parasites. Hopefully it's not too late. Good luck and let us know if you're able to save him.
The most common medication suggested for internal parasites is Maracyn-Two, as this medication can be absorbed internally.
View Healthy Betta’sAquarium & Fish Medication Dosing Made Easy for simple 1-gallon fish tank medicine doses.
Medicated food is another common treatment method suggested for internal parasites, used in conjunction with a treatment in the tank. It should contain an anti-protozoa ingredient, such as Metronidazole. Pepso Food made by Jungle Labs is intended for internal parasites.
If your betta should die, scour and scald the tank or bowl he was in in order to prevent passing the parasite on to a new fish.
Remember, do not treat your betta with medication for an illness you are not completely sure of. If you are not sure if their symptoms match a particular illness, investigate further.
Added aeration may be beneficial for your betta while treating with medication to provide them with more oxygen.
Clean water is always important for a betta, but is especially beneficial for any betta facing an illness. You may find it helpful to change your betta’s water more frequently while you are treating with any medication.
Always keeping your betta warm, between 76-82 degrees F, will also help them to feel more comfortable and raise their immune system.