Sure it is not going into 4wd? Shift it to 4x4 Hi, drive slowly on dry pavement (parking lot) and make a 'hard' right or left hand turn, does it seem to buck /jump or act like the brakes are coming on then releasing? If so 4x4 is working!! If not suggest having the transfer case module scanned for trouble codes.
positive it is not locking in when it first started messing up sometimes u could lock it in then it wouldn't unlock sometimes it would be the next day before it would go back to 2hi . do you have to take it to a GM dealer to have the codes ran or can a parts store do that to.
Any repair shop with a professional scanner can do the test. Parts store, no, dont have the right equipment. Just to many possibilities to guess at it. Testing will save you money in the long run. The dash switches give some trouble but there again that would be guessing.