1998 Ranger?
Battery light is a pretty simple circuit
Key on 12volts--------battery light bulb--------voltage regulator---ground
In 1998 the voltage regulator is inside the alternator, the 3 wire connector, battery light uses the light green/red stripe wire on this connector
When key is on battery light has 12volts on one terminal, but if there is no ground on the other terminal then bulb will be off
When alternator is off, or not working, then the light green/red wire is a Ground via the voltage regulator, so battery light bulb is on
To test this, unplug the 3 wire connector
Turn key on
Battery light should be OFF
If its on then the light green/red wire is shorted to ground, or bulb is inside cluster
If battery light is OFF then plug 3 wire connector back in, battery light should now be ON
Start engine
Battery light should go OFF, if not then there is a problem in the Voltage regulator
Alternator can still work, but it can also burn out a battery if its overcharging it for long periods of driving
The whole point of having a voltage regulator is to maintain a voltage range that won't damage battery or electrics
Car/truck batteries have a voltage range of 12.3v to 12.9volts
12.9v new battery
12.3v after 5 or 6 years and time to shop for battery sales
Alternators have a voltage range of 13.5v to 14.8volts
So voltage from the alternator is always higher than battery voltage, which means it runs ALL the electrics in the vehicle when its on and working
AND voltage will flow TO THE BATTERY to keep it charged up for the next startup of the engine
But if you send a 12.5volt battery 14.5volts for a long time, over 10minutes, then the battery will start to vaporize fluid inside, called "cooking" a battery, this WILL shorten its life
The voltage regulators job is to prevent this and to maintain a narrower voltage operating range
Voltage regulators use whats called "push back" in the circuit
When you use the battery to start the engine it loses some of its "charge"
So just after start up there is less "push back" in the system
So voltage regulator might send out 14.5volts
After 3 to 5min battery is charged up and has higher "push back" so voltage regulator lowers the voltage to 13.9volts
As you turn on lights or blower fan to HIGH "push back" drops so voltage regulator responds but in AMPs not voltage, so you would see voltage go up to say 14.2v then drop back to 13.9v, amps were increased but volts stayed the same, except for the initial spike when the high amp draw of the electrical device was added to the system/circuit
You need a volt meter to test any of this
And do NOT unhook a battery cable with engine running, even in the "bad ol' days" with external mechanical voltage regulators it was not a great idea
With the newer, 1980's and up, electronic systems when you reconnect the battery there WILL BE a voltage spike, which can be bad for any electronics in the vehicle
So if you want to do this old school test then after unhooking NEGATIVE battery cable, to see if engine stays running, if it does stay running, then SHUT OFF THE KEY, and THEN hook negative battery cable back up
Get a $10 volt meter