Hi
Sorry about your loss
Bettas can have a number of problems caused by inbreeding and poor sanitary conditions where they are bred in various fish farms around the world, but mainly in tropical Asia. If the fish did a stringy white poop, stopped eating and swelled up overnight, (scales sticking out is another possible symptom), then it had an internal bacterial infection and they usually die within 24-48 hours of showing these symptoms. Death is caused by internal organ failure caused by the bacteria doing extensive damage to one or more internal organs.
The most common cause of internal bacterial infections nowadays is Fish Tuberculosis (TB). This can spread to other fish in the tank and tends to kill one here and one there. The fish all develop the same symptoms (stop eating, stringy white poop, death). There is no cure for Fish TB and once it's in a tank, it's there until you strip the tank and start again. If you do this, you usually kill any remaining fish and bury or burn the bodies, then start with new stock. The problem is you don't know if the new stock is free from the infection and fish can carry the Mycobacteria for months before developing any symptoms. So most people just say it's possibly in the tank and monitor the fish for those symptoms.
If it is Fish TB, you should try to avoid getting aquarium water on any open cuts, scratches or wounds because the Mycobacteria can cause localised infections in the skin and these need to be treated with antibiotics. If you have any cuts, scratches or open wounds, avoid working in the tank until they are healed; or wear rubber gloves and wash your hands and arms with warm soapy water after going in the tank.
If you get any small sores that don't heal after a couple of weeks, go to a doctor and tell them your fish might have Fish TB and ask them to take a swab of the wound and send it off for culturing and testing. The doctor will probably try to put you on antibiotics while you wait but tell them you want the results before taking anything. After you get the results, then take whatever medication is needed.
If you take antibiotics before the infection is properly identified, you can make the problem worse. A lot of Mycobacterium infections are resistant to various drugs and if the doctor prescribes you with a medication that the infection is immune to, you simply make the bacteria harder to kill.
If you need to do something while you wait, try rubbing raw honey into the wound and putting a tissue over it to stop it going everywhere. Remove the tissue twice a day and wash the wound with soapy water. Dry with another tissue and re-apply more honey. Do this for a week and it can sometimes help.
---------------
Having now got you all concerned about Fish TB, it might have been another type of bacteria that caused this or organ failure caused by inbreeding. So don't panic too much, just monitor the remaining fish and avoid getting tank water on open wounds from now on.