Please help! My betta is flaring a lot and swimming erratically.

He has been doing this for about 20 minutes now. I changed his water yesterday. Also, i know his tank is small, I plan to upgrade.

I am not an experienced fish owner by any means. This is my first fish and I ended up with him unexpectedly (a dummy brought him to a white elephant christmas gift exchange and I ended up with him). Crazy I know.

Anyway, he doesnt usually act like this. Hes usually calm. Any ideas as to what is causing this would be so helpful. Thank you.