When you engage the lever into a 4wd range. A vacuum switch is activated, sending source vacuum through metal lines and hoses to your actuator.
The vacuum ends up in a canister which pulls the shift fork holding the engagement collar that joins your stub axles togenther. This movement also closes a switch for the dash light.
I'd start with checking all the steel and rubber vacuum lines, and then the transfer case switch to make sure it allows vacuum through when in 4wd. Steel lines rust and vacuum lines crack.
Once you're certain you have good vacuum at the correct times but still no 4x4 you can check the axle canister and the shifting mechanism.
Or you can junk all that and get or make a posi lock cable system. The initial install is a pain but certainly worth the effort.