Is the "check engine" light on? If it is; the computer should be scanned for stored trouble codes; as this will tell you what to check to locate the problem.
If the check engine light is not on and has not been on; have a cylinder compression test done on the motor. Find out the manufacturer's normal compression pressure and minimum allowable compression pressure from a service manual; and compare each cylinder reading to these standards. In addition to the minimum limit; there also cannot be more than 15% difference between any 2 cylinder pressures. If the compression in all cylinders does not meet each of these standards; the motor must be overhauled or replaced.
If the motor passes all the compression standards; I would perform the following procedures:
1> Thoroughly clean the mass airflow sensor, idle air control valve and throttle body; using only mass airflow sensor spray on the mass airflow sensor.
2> If the PCV valve has not been replaced; replace it.
3> Tighten all the intake manifold bolts and fasteners in the throttle body.
4> Check all the vacuum hoses for leaks, damage and loose connections.
5> Thoroughly clean the EGR valve and its connecting passages in the manifolds. Make sure it opens and closes smoothly and consistently. If the valve does not operate consistently; replace it with only Airtex/Wells #4F1298, which is an improved design.
6> Replace the ignition coils with only Airtex/Wells #5C1412; which is a vastly improved design. Ignition coil failures are widely reported on this motor.