In the short term you need to change 50% of the water.
Im going to link to a another thread advising on what to do should you find yourself in the situation you find yourself in.
https://www.aquariumadvice.com/forum...re-377527.html
Im also going to link a thread that demonstrates quite nicely why goldfish shouldnt be kept in a 5g tank.
https://www.aquariumadvice.com/forum...ve-265871.html
Goldfish get very big if kept in a suitable environment. And live decades. Those little fish will grow to 10 or 12 inches. If they are kept in too small a tank their bodies stunt, their internal organs cant grow properly, they suffer from ill health and shortened lifespans.
So, longer term you need to decide how you want to proceed. If you want to keep your goldfish you need a much, much bigger tank. At least 20g for 1 goldfish and another 10g for each additional goldfish. A pond would be even better. Or, if the 5g tank is more to your liking, then replace the goldfish with something more suitable like a betta.
Trying to keep goldfish in a 5g tank will be impossible. You will always be battling against something and eventually the fish will just die. You may get away with it for a year or 2, but as said they should live decades. Moving them to a bigger space as quick as you are able will prevent stunting and lead to much healthier fish longer term.
You need to cycle the tank. There are some links in Autumnsky's thread that explain that, or we can post some advice directly in this thread if you prefer.