EEWW!!! That looks terrible like a very very bad case of ick or either a fungus of some kind. My gold fish had a fungus thing going on about a year ago but I went to the fish store and got some tablets that I put in the tank and it cleared up finally.
Go to a fish store and maybe you can tell them what happened, it would be a good idea to bring your picture to the store and show them and hopefully they can show you wat to get to help your betta!
You could also get some ick drops to be on the safe side just incase that's what it is--I've never seen a fish with that bad of ick though. ick drops aren't harmful though even if the fish doesn't have any so go ahead if you want to and put some in with him, but make sure not to put too many if you do.
*Some people come into your life and quickly go, but some leave footprints on your heart and you are never the same*
*We only fall so we can learn to pick ourselves back up*
*Life is not measured by the amount of breaths we take but by those that take our breath away*
*Life is made of millions of moments, but we live only one of these at a time. As we begin to change this moment we begin to change our lives*