To answer your question, you get rid of diseases by preventing their occurrence in the first place. This can be done by having a cycled tank, from buying healthy fish from a reputable source, by doing weekly water changes(or whatever it takes to prevent ammonia and nitrite exposure), making sure you have sufficient filtration in relation to fish stock, by keeping the substrate clean(either by vacuuming or by having a planted tank) and by feeding nutritious food but not over feeding, etc.
If you are unfortunate enough to have a outbreak of illness after doing all these things for prevention, then and only then would I suggest using medication. This is likely what you would have to do if your fish were riddled with parasites, generally speaking and from my own experience, good, clean water and a well maintained tank will do wonders for preventing and curing most other illnesses/conditions.