TEST THE WATER. Do a large water change add aquarium salt at the rate of 1 TBSP per 5 gallons or 15 grams per gallon, and add epsom salt at the rate suggested above. Floating indicates they are unwilling (because it hurts) or unable to compress their muscular sack surrounding their swim bladder. Inflammation can occur from bad water quality (mostly high nitrates), physical injury, bacterial infection, or parasite infection. Usually in that order. A shot of cortisone from the vet would help. You can also feed them small bits of licorice root. The alkaloids in the root that make it sweet are anti inflammatory and act like cortisone on the goldfish. Oh yeah, if it's an egg fish like an oranda, raise the temp to 72 degrees.
Best of luck,
Glenn