Idle Air Control Valve, take it out from the back/bottom of the intake manifold, clean it put it back on, disconnect TPS (engine should die or lose rpm's) set the idle screw on the IACV at 700-800rpms, if you can with a timing light set the timing at 20 degrees 15degrees if SOHC KA) should be a mark on the crank with the nipple from the front cover, plug the tps connector back in idle shoudl raise and fall back to where you set the rpms at before. if problem still exists REAPLCE IACV. they ussually get gunked up and cause malfuctions. If this dosnt work you have a vacumn leak somewhere, ussually a very small hissing nose depending on the size of the leak.
if you dont know the notches on the crank are, the notches are like this first notch is 5 degrees then Top Dead Center then 5 degrees then 10 degrees then 15 degrees then 20 degrees <thats what you want to set it at on a DOHC KA.
Theres ALOT more added into this for diagnosing the problem like checking ecu for codes and checking to make sure the IAVC is getting power. but 90% of the time the IACV is gunked up or bad.