Hi, my name is Kerry
These engines have a number of sensors, you would need a scan tool to determine if one is at fault.
Here is a link to a scan tool, you will also need a laptop.
You can do a couple tests without the scan tool, you can check the spark and the compression.
This could be caused by a faulty sensor, poor compression on one or more cylinders, a faulty injector or an ignition problem.
I would rule out the spark and compression first, if both are good, the scan tool is less expensive than an hour of shop labor.
Here is a link to parts diagrams.
Hope this helps.