1997 Ranger should have 6 wires on power window master
12v key on power, blue/black wire
Ground, black wire <<< this is the ground for passenger side switch as well
white/yellow and tan/blue wires that run to passenger side switch
2nd tan/blue wire and a white/black wire that go to drivers window motor
This 2nd tan/blue wire can run to GEM module and "one-touch" module if your Ranger has that "one touch" option to roll window down all the way without holding button down
All power windows work the same way
A power window motor has 2 wires, if one wire is 12v and the other a ground then motor turns clockwise, if you Reverse the 12v and ground then motor turns the opposite way, window up/window down, by reversing polarity
When the switch is in the Neutral position BOTH motor wires are grounded inside the switch
So to roll window up or down you just need to switch 1 wire to 12v because the other wire is already a ground
When you press the up button that motion disconnects that 1 wire from ground and connects it to 12v instead
Passenger side switch has 2 wires from Master that are its grounds for the motor
Passenger side has its own 12v key on wire
The master can sends its 12v to either wire to control passenger window
And passenger switch can use its own 12v to control its window
So the masters 1 ground wire is very important, as it grounds all 4 motor wires when switches are in Neutral
Switches are mechanical devices so DO wear out
They can also get moisture inside if a window is down when it rains because of their location