Well, of course there is no guarantee that fish you see, you are interested in (and you are going to buy) is totally healthy. A Fish can appear as healthy as it could be but in fact it has invisible inner problems. There are many ways, many things you should seek out to determine if a fish is healthy.And here's a list of some:
Firstly, look for physical characteristics of good health. A healthy fish should have bright body color, not pale or dull. However darker or patchy coloration may be an indicator of stress and not of bad health. Before you buy a fish, find out how it should look under normal conditions. No open sores, boils, ulcers, peeling scales or blemishes. No visible parasites, such as tiny white crystals that look like salt or tiny black nodules that look like "blackheads". There are also viruses, like Lymphocystis (cauliflower-like growths on edge of fins). Be sure to examine fish before buying it.
Eyes should be clear, not cloudy or popping out of sockets. Fins are erect, especially top fin (dorsal). Buckled fins can mean trouble. No ragged, torn or ripped fins. All of them should be intact.
Scales are flat and smooth, stomach is well rounded, girth of entire body is of normal size, not bloated or sunken. Visible fish waste should be dark in color, not pale.
You should also examine their behavior! Healthy fish should breathe normally, not guzzling for air or hanging around top of tank where its mouth kissing top of water. Compare gill movement of a fish with other fish in tank. Extremely rapid gill movement may be a sign of stress.