The normal size tank is 15 gallons for one gold fish and for two gold fish you should have a 40 gallon tank, which is double what you have. The first thing you need to do is a 3/4 water change. I suspect that the water parameters are way off because of the two fish being housed in a tank that was a bit too small for the,. You need to get an API master test kit. This kit contains test tube to test the Ammonia, Nitrites and Nitrates as well as the PH. The levels should be Ammonia 0, Nitrites 0, Nitrates 20 ppm or less and the PH at 7.0. These water parameters if high because of feeding and debris can cause the water parameters to get out of hand. This in turn can stress the fish leaving them lethargic, with swim bladder and serious ill.
We can take some measures to help the remaining fish.
1) First do a 3/4 water changes suggested above and be sure to add some de-chlorinator or use bottle Spring water for replacement.
2) Next please feed a couple of frozen peas in which the shell has been removed.
You will need to be sure you crush the peas for the fish. This helps the stool to pass and will sometimes help to relieve the problem of bloating.
3) I also suggest using aquarium salt at 1 teaspoon of the salt per gallon of water. The Salt helps to draw out fluids that can cause swelling in the swim bladder disease.
These are a couple of links that give you information about swim bladder disease:
The aquarium salt I recommended is very important, since it can help with stress, reduce swelling, help with any fungal infection, bacterial issues, parasitic issues or Ich. You only add this one time after the initial water change.
I suggest that once you do the 3/4 water change, you do a daily 50% water change for the next week. you can reduce to a 25% water change. Checking the water parameters will help you to know when you need to partial water changes. I believe if you can get the water quality under control, you should see some improvement in the fish. Please let me know if you have further questions. My goal is to give you 100% Excellent Service. Joan