How does O form an anion?

Oxygen (O) has six valence electrons. To achieve a stable octet configuration, oxygen gains two electrons, forming an anion (O²⁻) with a negative charge.