I'm unsure of what happened here. I got home from school and he seemed a little lethargic, but he still cam to the front when I went to the tank. A few hours later, I went to feed him and he was in the corner not moving and breathing heavily. As I watched he sank onto his betta hammock. He appeared to be dead and I watched for a little longer and he darted back to the surface for air, only to fall back down again. After this I put him in a cup floating inside the tank with a few cm's of water so he can breathe easier and some stress coat. I'm really unsure of what's wrong with him so anyy inf would be appreciated!
EDIT: He survived the night, but is still acting the same.