|if they dies within a week they may have had something when you bought them.
This probably isn't the case. Goldfish grow to over a foot long sometimes 15 inches. Also their lifespan is 10-12 years. They're not "bowl" fish. They produce twice the am't of waste as other fish their same size. In short, they're not good beginning fish. I have a 55 gallon tank with one full grownh goldfish. That's it. And even then it's hard to maintain and keep clean.
When you put a fish into a tank that hasn't been cycled (had any fish in it prior) it will have to cycle. The water in there is pure, thus no bacteria. When the fish poops in the water or excess food decays it produces ammonia - toxic to the fish. Gradually bacteria build, breakdown the ammonia, and produce nitrites which are also toxic to fish. Different bacteria build up to breakdown the nitrites and produce nitrates. Nitrates are relatively harmless unless the build up past 40. Once they hit 40 you need to change a portion of the water to get rid of them, and introduce new nutrients in the water.
Please do your research before purchasing anymore fish or other animals you don't know much about