A loose belt will probably squeak, not cause the alternator to stop charging intermittently.
I had my alternator battery light flash when I had the battery voltage up to 14.4 volts, but it stopped when I shut off my solar system (on a Ford Motorhome).
You should check the battery voltage. Driving down the road it should be reading about 13.5 volts +/- 0.5 volts. At rest the battery if it is full should be 12.7 to 12.8 volts, and if you turn on the headlights it should not fall by more than 0.4 volts.
With the engine running, at idle, if you turn on the headlights, the votlage should stay the same, perhaps drop 0.1 - 0.2 volts but not more than that. Sometimes the turn indicators will cause a slight voltage loss when they are flashign on. If the battery light is flashing on and off with the turn sinals or emergency flashers, it can indicate a alternator that might need replacement soon, but it is also something I would not let worry me.
If you do someone a favor, and use your car to jump start theirs, shut off your engine while they crank over their car. Your alternator is not required to start their vehicle, your battery will provide plenty of power, yet the alternator will go into the full capacity charge mode, and can melt the diodes inside the alternator while this is happening.
If you have been jump starting cars recently, you might need to replace the alternator. You can get them cheap at most junk yards. It does not have to be from a Ford Ranger, the alternator from another Ford product should fit. Look at the same size engine, such as a minivan, or small sedan. If the mounting brackets look the same, then it should fit, but be careful when measuring and compare it to your current one at home, if the belt mounting location is farther from the tabs, and not an exact fit, the belt will not line up correctly.