For many of us it's sensible to teach our children to say, "No" - especially to strangers who offer sweets and rides. It is best to keep things very simple and concrete. We can tell a young child that an older child may want to touch her private parts, but she shouldn't let him or her. This can be brought up in connection to bathing and toileting, activities where parents normally touch a child's sensitive areas or in response to a question, or after a child has been playing doctor. I think repetition helps.
We can teach our child to say, "I don't want you to" and then tell you what happened. We can add that, "Sometimes a grown-up may want to touch you, or want you to touch him, but you should not. Tell him you don't want him to. Then tell me. It won't be your fault". Children typically don't report these incidents because they feel guilty, especially if the molester is a relative or family friend.