This how-to is done on a 2004 4.0L SOHC Ranger. It is a good idea to remove and clean your IAC while you're doing this as well as peace of mind.
-CRC Throttle Body cleaner spray
Start by pulling the plastic throttle body cover. Its held on by 3- 7mm screws.
Disconnect the vent hose on the intake tube going to the crankcase
Disconnect the pigtail from the MAF sensor
Loosen the hose clamp holding the intake tube onto the throttle body. I used a flathead screwdriver but you may also use a socket if you'd like.
Pull your intake tube off of the throttle body along with the airbox cover as 1 piece and set it aside.
Using your trim tool, pull up on the clip holding the wiring loom going to the pigtail plugged into the throttle body. You may use a flathead screwdriver as well but since i have a trim tool, i used that.
Pull the pigtail off
Remove the throttle cables. the one on the left, you pop off of the clip. push up on the throttle mechanism to get some slack.
then pull the other cable. push upwards on the mechanism as well and pull it out
using your 5/16 socket, pull the 4 screws holding on the throttle body. I did the lowers first then the uppers. make sure you're using 1 hand to hold the TB or it will fall once you get the last screw off of it.
Spray the crap out of the TB and clean both sides. open up the butterfly and clean it real good. I cleaned everything, even the mounting surface on the truck since it had a bit of dirt around it.
Before (IAC is missing because I was cleaning that as well. made a how-to for that as well):
reverse order and you're done. On first start, your truck will idle a bit weird. let it run for about 10 minutes then shut it off. wait 5 mintues, start it back up, and it should be idling better. My truck runs a lot better, is more responsive, and feels way better shifting into gears from a stop than it did before.