At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
they need to be by another element
they need the attraction of another element otherwise there would be no reason to lose or gain electrons. When they come in range of an element that has something they want like an electron to complect their outer shell to make a stable octet then they go OOOOO I like what you have and steal or give whatever they need (:
You mean in principle or in practice? In principle, if a bunch of Na atoms are near a bunch of Cl atoms, the Na's can all give up one electron, which can go over to the Cl's, making Na+ and Cl-, and then the Na+ and Cl- can organize into a big cubic array, and the energy released by the formation of that array is enough to compensate for the energy required to transfer the electrons, and then some.
In practice, most ions that will form common ionic compounds are already ions, and have been for millions of years. They just switch partners all the time, moving from one ionic compound to another. For example, you could have some Na+ lying around in a deposit of the mineral trona. The deposit could get exposed to rain and wind, and weather, and eventually those Na+ ions could get dissolved into water, which flows down to the ocean. Then, some ocean water could get trapped and evaporated, and the Na+ could find itself partnered up with Cl- that was in the water, and NaCl could form as the water evaporated. And so on. It's very, very unlikely that the Na+ will ever be reduced by natural processes to ordinary sodium metal (Na), because there are just too many ways for Na to be oxidized to Na+.
Indeed, the bulk of chemistry before the modern era was entirely devoted to figuring out how to reduce metals from the oxidized state they are almost always in, naturally, to the pure metal. First we learned to reduce copper, tin and lead, which are relatively easy to reduce. Then iron, nickel and zinc, and only lately titanium, aluminum, and the very active Group 1A and 2A metals.
Nonmetals are a slightly different story, because they can often be part of covalently-bonded chemical compounds. So a chlorine could be part of a molecule (a chlorate anion, for example), and then various chemical reactions could force it out, but if it does come out, it will almost always be as the chloride (Cl-) anion, and not as Cl2 gas.