Metal elements form positively charged ions called cations because they are located on the left side of the periodic table. Groups 1 and 2 are called the alkali metals and alkaline Earth metals, respectively. These elements all have valence electrons in an s orbital. These electrons are relatively easy for the atom to lose to achieve a stable octet of electrons in its outermost energy shell. When the atoms lose electrons they become cations. Examples here include sodium and magnesium to form Na+ and Mg++.
The groups in the center of the periodic table are called the transition metals. They all contain electrons in d orbitals. These d orbital electrons are easy to lose in different numbers so the atoms can often lose different numbers of these electrons to form differently charged cations. An example here is iron. It can form either the Fe+ ion or the Fe++ ion.
Non-metals are on the right hand portion of the periodic table. As such, they have too many electrons to lose enough to form a cation with an octet. Consequently, they tend to gain electrons to form negatively charged ions called anions. An example is chlorine. It has seven valence electrons and it accepts one additional electron to form the Cl- anion.