Ditto what Danielle said. Get them before they hit plague proportions, and if you use a chemical treatment, if at all possible, get the fish out of the picture.
Do a search for "Flatworm eXit" and my user name and you'll read a lengthy tale of woe. I procrastinated and the infestation got to be horrible - and the sheer number of dead flatworms poisoned my fish (note: I didn't have an ammonia spike - it was the toxic secretions from the dead worms). The chemical did exactly what it was supposed to do, and I do not blame the chemical for the problems I had.
Having said that, I've sold some Flatworm eXit to others, being sure to tell them about my experience, and there have been mixed results. Most people with small infestations, if they followed the directions, had no problems. I had a collossal infestation.
Jenn