The reason for your fish being at the top of the fish tank is because it has swim bladder disease.
To fix this problem, take a few frozen peas and thaw them out.
Then remove the skin, cut into small pieces that the fish can eat,
then put it in your fish tank. Make sure the fish is able to eat it.
Goodluck and hope this helps!