An ion is formed when an atom gains or loses an electron. An atom which has lost one or more electrons has a positive charge. The protons remain the same
in number but are no longer balanced by a full complement of electrons. The atom has become a positively charged ion. If, on the other hand, an atom has gained an excess of electrons, it has become a negatively charged ion.
Metal atoms tend to lose an electron (or electrons) to become positive ions. Non-metals tend to gain an electron (or electrons) to become negatively-charged ions.
Ions with opposite charges attract each other, and ions of the same charge repel each other. Because they are charged, ions which travel through a magnetic field are deflected by it.
Ions can occur in gases and liquids, but tend to rapidly join with ions of the opposite charge and neutralize each other.
Metals are a different story. As shown in the accompanying diagram, ions form bonds with each other in a geometric pattern, called a “lattice.” The ions are shown in blue with a central black nucleus. The outermost electrons of each atom are not tightly bonded within their nuclei. The electrons fly loose and form a jittering sea of electrons not bonded with any particular ion. This leaves the blue/black ions with a positive charge.
The loose electrons are called “free electrons” or “conductivity electrons.” They are responsible for the good heat and electrical conductivity of metals. They also play a key role in magnetism.