Try things in this order [cheapest parts to most expensive]:
1. Check and clean Air Filter and any breathers [unlikely to cause the problems you said, but not unheard of]
2. Check Idle Control Valve and replace if necessary
3. Check Potentiometer and replace if necessary
And let us know how you get on