#1 genetics
#2 water quality
#3 diet
Genetics...at least once you actually have the fish...is a done deal, beyond your control. And water quality is simple; change enough of it often enough and it will be good...although there is far too much reliance on gadgets and potions and "overfiltration" by many aquarists.
But diet is a tricky one. You see many items on the market that trumpet themselves as a complete and balanced diet for aquarium fish. But stop and think what is included when we say "fish". That's an entire Class or Superclass of animal life; saying that a food is complete and balanced for "all fish" is akin to selling a bag of mysterious pellets that are claimed to provide balanced nutrition to "all mammals". And it isn't as simple as splitting them into herbivores, carnivores and omnivores, although that's certainly a step in the right direction; the type of foods that a given species has evolved to utilize covers a gigantically wide grey scale, ranging from 100% vegetarian to 100% carnivorous and every shading in between.
If you are doing something wrong in this area, you might not know it for a long time, perhaps not until it's too late and you discover the problem by necropsy. You can read the sides of fish food cans all you want, and applying a little common sense and simple deduction to your research should help you along the correct path...but it's hard to know for sure.