You should clean your goldfish tank once a week. Ideally, you should clean your tank every time you do the weekly water change. Aside from changing 10–15% of the water, you should also clean the tank’s gravel and scrape away any excess algae.
You should also deep-clean the tank once every six months. To do this, you’ll need to relocate your fish to another container. Drain roughly a quarter to a third of the tank’s water and turn off all the tank equipment.
Then, suction out the debris from the gravel, scrape away excess algae from the tank’s surface, and clean all the decorations with running water.
After you’re done, replenish the water level with treated water, turn the tank’s equipment back on, and let it sit for at least two hours before putting your goldfish back in.