Unfortunately it is not that straightforward.
(Very simplified) The ECU controls idling (and pretty much everything else) by using readings from a number of sensors, and then calculating what adjustments to make to achieve the required function.
When an unexpected condition occurs it can cause fluctuation in engine revs, warning lights or shutdown, (any, all or others) depending on what the error is.
Any of the sensors can potentially fail in a number of ways, along with other factors such as voltage fluctuation (bad connectors, failing battery etc.)
Some failures can be fairly easy to identify just by sight or sound, but most require more information to diagnose.
The ECU logs problem codes every time it comes across something which is unexpected, and these should be read using an OBD reader (
MultiECUScan is spectacularly good for this on Fiats)
Checking out the common issues (poor connections, loose connectors, leaks, battery etc.) is a good first step if you don't have a reader, but reading the logged codes is almost always the best next step.
The information from the ECU then should be properly understood before any parts are changed. The important part of that is understanding what caused the codes - for example a pressure differental between sensors could be a failed sensor, but it could also be a split pipe, loose clamp or bad connector. Decent mechanics will look at the surrounding areas and investigate properly.
Not-so-good ones will start swapping parts straight away.