Welcome. It sounds like either a problem with the 4WD switch, or a transfer case motor issue.
Here's some technical background on how the '98 4WD system works, including how the TC shifts between range positions:
https://www.ford-trucks.com/forums/s...34&postcount=9
You should check all 4x4 related fuses and relays. See:
https://www.ford-trucks.com/forums/6...-flashing.html