It is important to give you engine size, approx mileage etc etc, if you want answers.
ANyway, Could be a couple things, but usually your Idle air control(IAC) is what controls idle.
Thiers a link in the
Tips and Maintenance that shows you how to test the IAC(amoung other things).
Has your fuel filter been changed recently ?
Might want to have you fuel pressure checked too !!
Fuel pressure on the 4cyl W/EGR -41-47 psi, W/O Egr-52-58 psi. The v6 should be 41-47psi.
Might also consider getting a professional fuel system cleaning. They do sell a Tool to do this your self, but they run $300-450 at Napa.
These modle GAs also have major troubles with the injectors getting clogged and creating all sorts of issues.
hope that helps!