Lift and support the front of the truck so the front wheels are off the ground ( take safety precautions, chock wheels, jack stands, etc )
Key on ( engine off ), engage 4x4 and try to turn the front drive shaft.
If the front driver shaft turns it is a problem with the transfer case.
If it doesn't it is a front axle engagement problem.
The front axle engagement problems are either rotten vacuum lines from the shift motor solenoids or the vacuum disconnect motor.
The vacuum disconnect motor ( Item #10 )
Close up of what it looks like :
The vacuum lines run to the solenoids
The Pink Vacuum line is the 2WD operation, the Light blue vacuum line is the 4WD operation. You can confirm the operation by applying vacuum at the solenoid, and the Vacuum disconnect motor should move.
If this tests good, check that there is not a crack in the vacuum reservoir behind the battery. The reservoir runs past the check valve ( that is to the intake I seem to recall ) and to a T to both solenoids. If the reservoir is cracked, it cannot supply vacuum to the solenoid and while it is operating correctly, the vacuum is not there to operate the disconnect motor.
The solenoids always have + DCV at them, the GEM controls them by applying ground to the solenoids.
Start by checking the front driver shaft, and work from there. If the front drive shaft spins, you have an issue in the transfer case, that is mechanical ( manual Shift on the Fly - could be hung up. you can try a dead blow hammer on the back of the transfer case, while trying to shift in and out of 4WD. Just be cautious that you do not damage the transfer case by hitting it too hard, too much or with a metal hammer ).