If you're having a rough idle, truck seems like it wants to shut off going into a different gear from a stop, etc, you may want to clean or replace your IAC. Its really simple to do. This how-to was done on a 2004 4.0L SOHC Ranger.
It may be a good idea to clean your throttle body while you're at it.
-CRC Throttle Body Cleaner spray (I got 2 cans because I did my throttle body as well)
First, Remove your throttle body plastic cover with the 7mm socket and 1/4" ratchet. There are 3 of them holding it on.
Locate the IAC
Next, disconnect the pigtail on the back of the IAC
Remove the 2 5/16" screws holding the IAC down.
You can see its really dirty
Spray the heck out of the inside with the throttle body cleaner spray. Use Qtips to get in the tight areas and get it as clean as you can.
Reverse order, done. (dont mind the throttle body missing. i was cleaning that as well, in another how-to)