Valency is defined as the combining power of an element. The atoms of an element can combine by gaining or losing or sharing electrons. An easy way to determine the valency of an element is to write its electronic configuration and see how many electrons are required (to be shared, lost or gained) to achieve the fully filled electronic configuration.
In case of sodium, the atomic number is 11 and hence, its electronic configuration can be written as:
`1s^2, 2s^2, 2p^6, 3s^1`
Here, the 3s orbital has only 1 electron, all other lower orbitals (1s, 2s and 2p) are completely filled. Sodium can lose 1 electron from the 3s orbital and achieve the fully filled electronic configuration. And that is what it does and thus, the valency of sodium is 1.
Hope this helps.