He's probably depressed. Bettas are prone to getting depression.
Yes bettas do get depressed and can actually do a type of suicide. They just give up and quit trying to live. He needs some stimulation and attention and maybe a diet change. Could he be constipated? It is very serious when a Betta goes to the bottom. He needs to have something interest him or move him enough to get him up. Watch his coloring close, if he starts to pale or change color he is sick.
If he is eating at all, try to give him some pea, just in case. If he is not swimming or eating, then if he is not alone in the tank he needs to go to a quarantine tank as he is sick.
The only other possibility that I can think of is low oxygen content in the water. Do you have an airstone running?
I do not know if this is the problem. At this point it is throw out possibilities and hope one sticks. He is obviously an unhappy betta and none of the possibilities are good ones.
Let us know how is doing and if we can help.
he hasn't been eating any peas are there any other laxatives I could use because I think it is constipation.