Elements that form anions are elements that need to gain electrons to form a complete octet. Elements in the sixth and seventh periods of the periodic table need to gain one or two electrons to have an octet.
Some common elements that form anions are hydrogen, fluorine, iodine and oxygen. Oxygen needs to gain two electrons so it forms an anion with a charge of negative two. By contrast hydrogen, fluorine and iodine only need to gain one electron so they form an anion with a charge of negative one. Elements in the seventh period often form ionic bonds with metals, meaning that they take the electron from the metal and leave the metal with a positive charge. One example is sodium chloride.