Sodium nitride is an ionic compound that is very unstable and easily breaks up to form sodium atoms and nitrogen gas at around 360 K.
The atomic number of sodium is 11. To achieve a stable electronic configuration it loses one electron to form a positively charged ion `Na^+` . The atomic number of nitrogen is 7. It can accept 3 electrons to achieve a stable electronic configuration. This leads to the formation of a negatively charged ion `N^(3-)` .
One ion of `N^(3-)` and 3 ions of `Na^+` together form the ionic compound `Na_3N` .