Sorry about that ...it happenes though . They get sick just like any other animal or human.
I hope you will rescue another betta that need home. And if you want we can figure out what happened so it will not happen again. Not sure how long you had him but sometimes people don't realize simple things they have to do, which can be very important in the fish care. So if you want we can try to figure it out.
Also i would use bleach 1:10 to disinfect the tank. There are lots of different bleaches out there. You must not use bleach with additives (many come mixed with detergent). So, find a bleach like Clorox Regular. Wash it million times and live it air dry for a few days , wash and rinse again before you use it.
You can disinfect the aquarium itself and hard pieces like glass thermometers, fish nets, hard plastic like the filter box (not the filter cartridge obviously).