Clean the IAC(idle air control) valve
google: clean iac valve
Warm up engine, let it idle and disconnect the IAC Valve wires, idle should drop to barely running or engine may even stall, either is GOOD, it means no vacuum leaks.
If idle stays high then you have a vacuum leak.
After that check the spark timing, you need a timing light and you need to find your SPOUT connector, it will be near distributor passenger side
Google: ranger spout connector images
Engine needs to be warmed up, and off
Hook up timing light
Loosen bolt that holds distributor tight, at the base of distributor, just needs to be loose enough to rotate distributor.
Set #1 spark timing at 10 to 12deg before TDC mark
If idle is still surging when cold the you will need to replace ECT sensor, $7.
Fuel injected engines have TWO engine temperature devices.
ECT(engine coolant temp) sensor, has TWO wires, only used by computer
ECT sender, ONE wire, only used by dash board temp gauge.
You need to change the TWO wire sensor
They are located near each other above thermostat housing