Ions are created when atoms lose or gain electrons. When an atom has a lesser number of electrons than protons it is positively charged as is a positive ion. This is the case when the atom gives electrons from its outer shell to atoms of other elements. On the other hand, when the number of electrons is more than the number of protons the atom is negatively charged and a negative ion. These are formed when the atom has acquired electrons from atoms of other elements.
For example take the compound NaCl. Here Na gives one electron to Cl. So Na has a positive charge and the ion is represented as Na+. Chlorine acquires an electron and has a negative charge. The ion is represented as Cl-
ioniosation means that a metalic or non-matallic element becomes an ion instead of being an atom by gainig or losing electrons (in order to complete its outer most energy level with 8 electrons and be in a stable state),,,,if the element gains electron during ioniosation so it is non-metal since it has already more than 4 electrons in its outer shell so gaining electrons is easier that losing for it like the chlorine atom= (electronic configration 2,8,7) & it gains an electron .
On the other hand ,the metallic elements lose elecrtons since they already have less than 4 electrons inthe outer shell so losing is easier to it than gaining like sodium atom =(electronic configration 2,8,1)& it loses the an elecrton.
tip: the metallic element which loses elecrton(s),loses its them from the outer energy level like Magnesium= (2,8,2) so it loses the 2 outer electrons .Sodium= (2,8,1)so it loses its outer electron in L level.
while the non meatllic elements which gains electrons put them in the outer most energy level like florine= (2,7) so it puts its new electron in the 2nd shell to be filled with 8 electrons. Chlorine =(2,8,7) also puts its new electron gained during ioniosation or chemical reaction in its outer level.
The inert gases they don't make ions or share in chemical reactions (concerning this part which talks about ions) because each one has 8 already electrons in its outermost shell & it needn't gain or lose electrons (except Hydrogen which has only one shell completely filled with 2 electrons & it also doesn't need to be ion)
Metals which lose electrons , give them to non-metals :like MgO=Magnesium Oxide where Mg loses 2 electrons to give them to the Oxygen atom which needs them so they make an ionic bond (meatl +non metal = ionic bond)