We need a lot more info than that before we can diagnose.
1. What size tank.
2. How many goldfish and how long have you had them.
3. What equipment do you have running on the tank.
4. What are the water parameter readings.
I suspect, without information being given, this is a water quality/tank size issue. Goldfish are large and very messy fish often mis-sold for tanks way too small for them!