Help

Hi i just got another betta fish yesterday and something is wrong with him. Hes breathing but not swimming i thought he might be dealing with some sort of exhaustion so i moved him to one of those temp holders. his water is fine nothing is off. He wasnt like this when i brought him home he just super lethargic and im not sure how to help him. He swims up to the top as hard as he can for air then back down he goes. I didnt attach an image bc im not sure how to put the spoiler thing on.