According to (n+1) rule governing the filling of electrons in a multielectron atom,
for 4s orbital, n+l=4+0=4
for 3d orbital,m+l=3+2=5.
Therefore, 4s orbital fille dbefore electron filling takes place in 3d orbital since it has lower energy. In case of ionisation of the atom, the electrons present in 4s orbital are loosely held by the nucleus as compared to 3d orbital. Therefore 4s electron is released prior to 3d electron.