Let me answer with a question (or two):
How do you identify in an electric circuit which parts are just the wiring and which are functional parts?
How's that for a mechanical engine? Can you tell cogwheels and cranks from "just the basic structure"?
It's all about pattern recognition in the first to identify the functional groups.
Next step is to know how they react under certain conditions. As a rule of thumb, a group with a high electron density will probably react with something more positively charged (think plus and minus attract each other).
But it takes quite a while and learning to predict exactly what will go on exactly in the reaction. But that not different from any other scientific/technical discipline.
I tried to keep this as general and simple as possible ;)
Edit
Let me work you comment in:
Generally molecules don't contain ions though
Says who? :D Molecules may contain ionic units, think in zwitterions of amino acids, think in all the mesoionic sydnones, münchnones and whatnot. Well, no. Forget about the special cases ;) But if it has more than one atom and is electrically neutral in total it is a molecule. At least in the less rigid sense of the definition.
But yes, the electronegativity is a good point.
Forgive me that I'm not going into detail why the example with fluorine and sodium is a not the best one, but in principle, you're right: Such a setup would allow to form a new $\ce{C-C}$ bond between a carbon that is negatively polarized (the one bearing the sodium) and another one that is positively polarized (the one bearing the halogene).