I would recommend gel food.
You can make your own or buy a premix from Repashy. Gel food is easier for goldfish to digest and can prevent issues like bloating.
A quality sinking pellet food for a main staple is my recommendation. Quality foods should have whole fish or plant matter in the first 3-4 ingredients. If it's corn, grains or fillers, move on.