To start with, you have done remarkably well to keep a goldfish alive for nearly a decade in such a small tank.
A goldfish should be kept in 80 litres minimum and 120 litres would be better. What happens when fish are kept in unsuitable environments they release hormones to stunt their growth and try to compensate for the lack of space. Their body growth stops but their internal organs continue growing. The lack of space for these organs means they cant grow properly, they dont function properly, this leads to ill health and shortened lifespans.
How big is the fish? At 9 years old it should be adult sized, say 8 inches long.
You are also detecting nitrite in your test. This indicates 1 of 2 things.
- You have crashed your cycle.
- Or, your filtration is simply not sufficient to remove all the waste your fish produces.
Is this nitrite something new, or are you only testing now because you are seeing an issue with your fishes health? High nitrite will also cause organ failure. You don't mention ammonia which is an important parameter to know. Im presuming you are testing with 5 in 1 test strips, and multi-test strips dont come with ammonia on them and have to be purchased separately. If you are getting a new test kit, get a liquid test kit like API Freshwater Master Testkit. It covers what you need (pH, ammonia, nitrite and nitrate), will be more accurate than test strips, and as you get 100s of tests from it will be more cost effective long run than strips.
My hunch is your fish living in too small space is catching with it. There will be the issues with healthy organ growth, and also its likely the stock filtration that came with the too small tank wont be sufficient to remove all the waste a goldfish produces. Goldfish are very messy, need big tanks and bigger filtration systems. Really in a 120 litre tank it should have filtration rated for over 200 litres. You have a 54 litre tank with a filter likely rated for the size of the tank.
What to do? If it is organ failure then there isnt much except make the fish more comfortable. Im kind of assuming after 9 years a bigger tank with sufficient filtration isnt on the cards, in which case more frequent water changes will help. Say, change 50% of the water twice weekly. Aquarium salt can help with nitrite poisoning, 1 tablespoon/ 4 litres of water.
I would also consider swim bladder treatment. Dont feed the fish for 3 days, if things dont improve then try and feed a boiled, shelled pea.
After that you need to consider the quality of life your fish is having. If its not eating, cant swim properly, and isnt responding to treatment then euthanising the fish will be the kindest outcome.