You need a heater. My guess is the water was 2 cold for them. How long was the tank set up before you put the fish in? How did the fish look in the store? Most fish petsmart and petco get are very young and it's common for this to happen.
If you're a glofish expert please help! All my glofish died what did i do? P.S. Sorry for the mispelling, i was trying to save space and i'm talking about GLOfish, not GOLDfish
Was this a newly set up tank? If so, that may be your problem. That or you added tap water without treating it with a dechlorinator first (like stress coat). Before buying more fish, add maybe 1/4tsp of fish food to the water and wait a week. Then test the water for pH (should be 6.5-7.5), ammonia (should be ZERO), and nitrate (should also be ZERO). Your fish store can do this for you if you don't have the test kits. Also there should be some algae or a little bit of coloration on the filter pad in the whisper. This means that your tank is populated with beneficial bacteria which help break down the fish poop. Good luck!
Check the filter if your fish tank is being filtrated. If its not being filtrated, then consider a filter or an actual tank that is not too small for one. You were only supposed to feed them once per day and clean out their tank once a week. If you used tap water, and you didnt use tap water conditioner, that could be another explination. Even if your fish didn't have any parasites, still put in a tablet or something to help prevent anything like that happening, such as ich. Or, the fishies you bought, could have been sick or something when you bought them. Just because they died, doesn't mean it was your fault that they died. Be extra careful.