Re: 2000 Ranger
My guess would be an O2 sensor. Go to a dealer, garage, or (some) parts stores, they can plug in and pull the codes and tell for sure. It can screw up the mixture and cause the rough idle. 9 times out of 10 if the Check Engine light comes on, it's an O2 sensor. Probably not the cause, but it's worth noting that the Ranger manual calls for a new fuel filter at 30,000 miles so if you have that many then get the filter done. (Auto tranny fluid at 30k too.)
'05 Sport Trac 4x4, L/S, torsion lift, extended shackles, 265's
'03 Taurus wagon, Silverstars, Yoko TRZ's
If you give a man a fish, he'll eat for a day. If you teach a man to fish, he'll sit in a boat and drink beer all day.