I believe the fist step to a healthy K9, is through their diet.
Now recent studies show kibble and all other processed dog for, readily available on the market, even if grain free, not to be the optimal nutrition for your K9. This is why I am an advocate of raw feeding.
If you can not bring yourself to feed raw, for whatever reason, then the second best option is a home cooked diet.
The raw diet has to be a balanced diet in order for it to be effective. I have added a chart which clearly outlines the different fruits, vegetables and meat parts, along with add-ons, to be mixed daily and fed once, twice or three times depending on the age of the dogs.
Lets go back a bit into the times where K9 or wolves, the ancestors of K9s ate primarily meat which is a high protein diet, with a bit of fat, offal, roots and grass adding to fibre, vitamins and minerals. The natural food of K9s is high in protein and fat as protein provides the essential amino acids that get broken down by the K9's digestive system and provides essential nutrients for their growth and immunity building. Grains and carbohydrates on the other hand are not something K9's would consume naturally and have been introduced by humans over a period of time. By adding grains or "fillers" to dog food we have changed the diet of the dog as well as the overall health and longitivtiy. Fillers are added for one reason only, they are cheap and that means more money for the companies who manufacture and sell kibble. You dog's diet is top of the list to keep your K9 healthy. So do your research and derive your own conclusion on what diet is best for your dog.
The second most important thing to keeping your K9 healthy is exercise. Both physical and mental stimulation has to be provided consistently. When I say exercise I do not mean an hour's walk on a leash around your local neighbourhood. Dogs need lots of space and at least one hour of running around chasing a ball or a rabbit each day. Allowing the dog to tap into their natural instinctive prey drive will use up the dog's energy and keep him happy. I always suggest if you have a working breed dog, which I consider most breeds to be apart from the toy breeds, to join an obedience, agility or sports dog group and partake at least twice a week. If you can do it at home or by yourself, even better.
Mental exercise is just as important. Games that make a dog use his intelligence and social drive along with focus commands and all basic commands stimulate the dog mentally, and help to build a bond and bridge of communication between you both.
Other Factors play a big part in your dogs health. Breed, Genetics, breeders are to name a few.