How old is the car? If it has an ECU, it could have developed a fault.
You can normally reset the ECU but disconnecting your battery for a period of time.. (Some people say 30mins, some people say over night).. Once you start it up again, leave the car to idle for 5minutes, and then drive the car around for 15mins at various rev-ranges to let the little clever box do all of it's mystical tricks! It should adjust itself to how it thinks it runs best, given what information it recievs from your engine sensors.. [CHECK YOUR OWNERS MANUAL FIRST IF YOU ARE UNSURE OF THIS PROCEDURE!!]
Here is where the fault MAY lie.. If you have faulty sensors, then the ECY is getting incorrect signals, and this may be why your engine is idling incorrectly.. It could be your idle control sensor (or stepper motor), or it might be your trottle postition sensor.. I'm sure there are alot of other sensors which could be responsible, but these are the two which spring to mind!
The problem could also be due to a build up of dirt in your throttle inlet. If you have some mechanical knowledge, you could remove your airbox, and use a cloth (best to use something like nail varnish remover on it aswell!) and wipe around the inlet, whilst holding the butterfly open. If you put the cloth on the end of a screwdriver you can get a bit further down and give that a good clean too!
It's best to start the engine after this (hopefully it's warm) and give it a good revving! If it's not warm, let it idle and get the oil temp up before you give it too many rev's! You could also use some carb and injector cleaner to help clear it out. You spray this stuff into the inlet while the car is idling, and it help removes the build up of dirt in your throttle plenum, as well as on the sensors, and in your injectors. Just spray short bursts in while you idle the car, and occasionally give it a blast of the throttle. Best to do both of these jobs at once, while the air box is off.
A bit fo reading there! Hope something helps! I've had idling problems with my car, and I know it can be a bugger! Can't say mine have gone away 100%, but I don't notice them now, so at the moment it's not an issue for me!
Freddie