For CO2 there is one atom of carbon and two atoms of oxygen. For H2O, there is one atom of oxyegen and two atoms of hydrogen. A moleclue can Be made of only one type of atom
Ionic bonds are stronger then covalent bonds.
Since Na has a 1+ charge and O has a -2 charge, by reversing the charges and placing them as subscripts for the other atoms the formula is Na2O1 or simply Na2O.