Its probably suffering from a swimming ailment of some type. Swim ailments can be caused by a number of things. I ts a good idea to check PH and Ammonia levels first thing if you see a fish unable to swim properly.
Constipation can also leave a fish unbalanced.
Treating fish that just can't seem to stay balanced is quite simple. Stop feeding the fish for about a week. If problem does no persist, chances are it was a digestive problem. You must alter the diet with non-dry foods. Dry foods absorb water easily and can cause the fish to float, which can overtime damage the swim bladder, causes the fish to become unable to float.