Is the Service 4WD light on?
Yes: Go to Section 1.
No: Go to Section 2.
Section 1: My Service 4WD light is on.
Are there any lights lit on the 4x4 selector switch?
Yes: Go to Section 2.
No: Try these steps.
With the ignition off, rotate the 4x4 selector switch from left (2HI) to right (4LO) and back again about 20-30 times. With lack of use, the contacts inside the 4x4 selector switch can get a light amount of oxidation on them. Repeatedly rotating the switch can sometimes clear this problem up. If this doesn't help, read step 2. If step 2 doesn't work for you, replace your 4x4 selector switch. If replacing the 4x4 selector switch doesn't work for you, try to find a local member with a verified working TCCM to swap in. If the problem goes away, return your friend's TCCM and buy a replacement for yourself. Search these forums for replacement instructions.
On some 2002 model year trucks, the Transfer Case Control Module (TCCM) can have trouble waking up when the engine computer tries to talk to it. Fuse #8 in the engine bay fuse block provides power to the TCCM. Pulling this fuse and replacing it will usually wake the TCCM up and allow the use of 4WD for a time. Fixing this requires either a dealer software update (can be spendy, doesn't always work) or replacing the TCCM with a unit from a 2003 or newer model with selectable 4WD.
Section 2: Checking the motors.
With the ignition on, switch the 4x4 selector switch from 2HI to 4HI. You should hear two distinct mechanical whirring sounds. One from the middle of the truck (under you) and one from the front of the truck.
I hear both whirring sounds: Go to Section 3.
I don't hear the sound from under me: There is an issue with the Transfer Case Encoder Motor. Check the connector going to the motor(cylinder looking thing) on the transfer case for damage/corrosion. The motor may require replacement.