Hi welcome to Fish Lore

Poor little guy, what's his name?
The first thing to do to help him along is get him into a proper set up.
IMO a betta should be kept in at least a 5 gallon heated, filtered tank. Several members have had luck keeping them in 2.5g
Once he's in a nice warm tank (approx 79-80F) he'll probably start to feel better.
To help his immune system and heal his fins I'd recommend Fish Protector, Garlic Guard (or a drop or two of garlic juice) and Vita-chem.
Here's our
Betta Care Guide
You'll also have to be very careful of
ammonia building up in his tank.
Here's an explanation of
Nitrogen Cycle
Since his new tank isn't going to be cycled (that can take up to a month) you'll need to do 50% daily water changes to keep the ammonia levels down. Not only because it's toxic to your betta but to help prevent further infection.
Use prime as your water conditioner, it'll help detoxify the ammonia for 24 hours between water changes.
At this point, I wouldn't jump to medication, lets get him in a nice warm tank and see how he does first.
He's a pretty boy , I hope he heals up quickly for you.
Good luck