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.