First, shift the transfer case into neutral and set the parking brake.
There's an actuator assembly bolted to the side of the transfer case, above the front drive shaft. It uses 3 15.. bolts to hold it on. You'll need to remove the front drive shaft to take it off. There's a harness plugged into the actuator. Be sure to disconnect it.
After you remove the actuator assembly, there's 4 screws (2 different size torx, 2 ea. #15 and 2 ea. #20 IIRC), then the end with the long plastic cover slides off. There's a big gear in there with a little dot on it (embossed). Make sure you note the position of this dot. It's very important to put it back in the same position. The gear slides up and out, disconnect the 3-wire connector on the back and look at the back side of the gear. That big round black thing is the sensor. It pops off with a flat bladed screwdriver. Pop the new sensor on in place of the old one. Reconnect the 3-wire connector to the new sensor, making sure to put the connector on the right way (it ]is possible to put it on wrong. Reinstall the gear, making sure to line the dot in the same place it was before you started. Replace the orange gasket around the perimeter of the actuator assembly, reassemble and reinstall. Use a zip-tie to replace the boot retainer ring on the drive line. Start the engine and shift the transmission back into neutral. Shift through all the transfer case selections, then back to 2wd. Drive happy.
Make sure you take it to the dealership for TCCM reprogramming. That's the part of this repair that makes it permanent.