Oh the 4x4 switch, not transmission gear selection.
A common failure on the 2002 model year was the TCCM (Transfer Case Control Module) would fail. Later years didn't have that issue. My 2002 Trailblazer did that. You can try resetting it by pulling the fuse for it, waiting a minute, and reseating the fuse to see if it will wake back up, but it may be dead.
As mentioned, if the TCCM is bad, replacing it with one from a newer year 4x4 is the best bet. A used one will swap right in and work, a brand new one is stupid expensive and then needs programmed on top of that. One from a Trailblazer or Envoy would work fine, don't get one from a Bravada, Rainier, or Saab because those are AWD and have a different TCCM.
Actually, I still have the TCCM from my Trailblazer kicking around. It came from a 2005 Envoy when my original TCCM rolled over and died. If you need one, I can see if I can dig it up.