Question
Why in the building of the atom, the filling of 4s orbital takes place before 3d orbital?
Solution
According to Aufbau principle, electrons first occupy the lowest-energy orbital available to them and enter into higher energy orbitals only after the lower energy orbitals are filled.

As 4s orbital has lower (n + l) value, it has lower energy and will be filled first.

As 4s orbital has lower (n + l) value, it has lower energy and will be filled first.