@ nilkanth
its a bit lengthy and complex process , so , u have to start from beginning , frst of all remember the sequence SSPSPSD , THEN read the 3 rules from ncert
1- hunds rule of max multiplicity
2- pauli exclusion principle
3- aafbau principle
then remember the energy sequence , so, that lower energy state shell will be filled first . after that takes care about the max . no of electron that a shell can hold .
then start filling it from lower to high energy level sequence .
for example – oxygen with atomic no. 8 , configuration – 1s2 , 2s2 , 2p6
ncert explained each and every step in detail . follow that and let me know if u cannot do config. of any element .
HOPE IT CLEARS YOUR DOUBT
ALL THE BEST