Just based on what you posted, it's very hard to say. My first guess would be low fuel pressure caused by, with most likely cause listed first:
A bad fuel pump
A bad filter / regulator
A clogged fuel pickup in the gas tank
A simple fuel pressure test will confirm fuel pressure, it should be 58psi +/- 3 psi with engine running and for many seconds after the engine dies (it will slowly bleed down after that). If fuel pressure is OK, we must look at throttle body and perhaps ignition issues like a bad cam position sensor or crank position sensor.
But when mine did this, I looked at fuel pressure FIRST.
This kit was $35 five years ago, inflation is killing us:
https://www.oreillyauto.com/detail/c...fa9a6257140594