4wd switch test
Here's how to test a 4WD dashboard switch on 2002 Ranger:
Looking at the back of the switch with the LED on top and the pins numbered from left to right 1,2,3,4 check for continuity as follows:
switch in 2WD position has continuity between pins 1&4
switch 4WH position has continuity between pins 1&4 and between pins 2&3
switch 4WL position has continuity between pins 1&4, between pins 2&3, and between pins 1&2
Don't take a switch apart to clean the contacts. It has a ball bearing and a spring inside and is hard to put back together. I tested a new switch and this is how it read. All other combinations show open (although I did see ~4k ohm between 2&3 in the 2WD position). This switch worked and solved an ongoing problem of getting back to 2WD.
Hope this helps!