Try to buy your goldfish from a tropical fish store
, rather than a big box retailer. A store that specializes in fish will have the knowledge to get you started, be able to tell you how to prevent and diagnose problems and will more than likely have a better source for their fish. The fry stock (parents) of the fish will determine how healthy they will be through the course of their life.