The Brainliest Answer!
Na^{1+}  +  O^{2-}
=Na _{2} O

Thus valencies get exchanged while writing formula.
1.The 1 of Sodium goes to Oxygen 
2.The 2 of Oxygen goes to Sodium.

NOTE:Na is Sodium element; O is Oxygen element
Not to confuse Atomicity with Valency. Atomicity is the number of atoms present in one molecule/atom of a compound/element respectively. E.g.- Atomicity of N_2  is 2 and that of Na is 1.
2 5 2
Its easy. Chemical formula is the method of communicating in chemical language.
It expresses state of the substances,temperature,catalysts,symbols.etc