We can find the valency of an element by the use of electronic configuration :
Electronic configuration refers to the no. of electrons present in one shell i.e. K,L,M,N are the shell
E.G. sodium :- electronic configuration -- K L M
2 8 1
so here in last shell there is 1 electron , so sodium can give one electron to complete its octave and to become stable .
hope it help u
pls mark it as brainliest answer