Metals have tendency to loose electrons in order to get noble gas configuration, therefore they loose electrons to form Cations (positively charged ions)
for example ~ Sodium forms Na+
And
Non - metals have tendency to gain electrons in order to attain noble gas configuration , hence they gain electron from somewhere and bears a negative charge forming Anion.
for example ~ Chlorine forms Cl-