It sounds like it has swim bladder disease.
here are some symptoms...
The betta is unable to swim properly, characterized by floating at the top, sinking to the bottom and/or listing sideways. The betta often looks like it takes it a great deal of work to swim to the bottom (if floating) or reach the surface (if sinking), and will pop back up like a cork or sink like a stone.
A constipated fish may look bloated (slightly or greatly), or seem to have difficulty passing feces