It sounds like your betta
is constipated, and has developed a problem with his swim bladder. Does he have difficulty staying buoyant? It's actually quite common and, if treated soon, he should recover fully in just a few days.
is used as a laxative to clear his blockage. Another option is to feed him a few small pieces of a pea. If you have some frozen veggie mix, microwave a pea for about 30 seconds, until it's warm. Then remove the outer layer, break off a small pellet sized piece, and feed it to him. A few pieces of this, and no regular food for a day (or two, or three), should have him back to his regular self.
Of course clean his tank and do a substantial water change also.
If he eats the pea, I wouldn't go the epsom salt route. If he doesn't eat the pea, dissolve some epsom salt in water that's the same temperature as his tank. I'm not sure how much salt to use (I've never had them not eat the pea, personally), but I'm sure someone else can chime in, or you can find this online. In any case, I wouldn't leave him in the salt water. It should be more of a bath, just for a short time, then back into the regular tank.
Sorry I don't know the details of the salt bath method, like I say, I've always had luck with feeding peas. Also, if he does have difficulty regulating his buoyancy, it's almost certainly a swim bladder disorder. In this case, you really don't need to add any medicines at all.