Got dash lights for the 4x4 selection?
Did you put the automatic trans in Neutral?
Or have the clutch pedal all the way down if manual trans?
Couple of fuses to check, in the fuse/relay box in the engine compartment, I think it is #9 40amp, that's the shift motors main power.
In the cab fuse box, check #11 and #17, both 15amp fuses
The electric shift motor can get loose brushes inside preventing motor from working, a few light taps with a hammer, or similar, will re-seat the brushes and motor will start working again, this is a temporary fix and motor will quit again and no tapping will get it working again, lol, so if a tap fixes it, plan on pulling it for a rebuild or replacement.
You can also pull off the shift motor and manually turn transfer case shifter to 2WD.