'98' Tahoe 4WD intermittent on/off

I recently was towing a trailer & the “Service 4WD” warning light came on & the indicator switches on the lower mid-dash wouldn’t show what gear it was in… I was able to continue driving though. It seems it ‘defaulted’ to 2WD. When started up again later the service light went out & once again it was in 4WD. It ran fine, turned fine & drove fine on ice & snow. However since then the “Service 4WD” warning light has come on & off several times as I stop & start the truck here & there. It kind of has a mind of its own. I’ve had some “feedback” that it’s going to cost me “a couple thousand” to fix it - to - “it may just be a module or sensor”. I’d like to get more suggestions before I go drop the money for some diagnostic comparisons.