The answer to your question is:
When non-metals form ions they tend to fill up their incomplete outer shells by taking extra electrons. This gives them a negative charge.
We have metals and non-metals. Out of these, metals are the ones that are more amenable to losing electrons and forming cations (positively charged ions). Metals have 'extra' electrons, i.e. to say they have 1 or more electrons in the outer shell that they can lose. For example, sodium has one electron in its outermost shell and loses it to become positively charged sodium ion, Na+.
Non-metals like to gain extra electrons, since their outer shell is deficient in electrons and can be completely filled by accepting extra electrons. And in the process, we get anions, negatively charged ions. An example is chlorine, which has 5 electrons in its outer shell and needs 1 more to achieve stable configuration and thus after accepting this extra electron, it becomes the anion, Cl-.
Hope this helps.