Could be several things. Is it cold? Fuel freezing or water in it. Check the fuel seperator and fuel filter. How old are they? Then look at air filter.
Then since it threw a code, what does the code say? That will narow it down if it is a speed sensor, low fuel pressure sensor, low air intake...