Cranks but dont run

my car has a good battery and now a new alternator the problem is that it cranks up and then dies any suggestions?

Need year, make, model, milage and engine.

1996 chevy cavalier z24 160,000 (round about)

Check vacuum hoses first, it is the cheapest. From there it could be fuel pump, coil pack, and even the fuel filter that may or may not have been replaced.

Start by checking your fuel line pressure. This is a typical symptom of a dead or dying fuel pump.

Post back with the results.

There is a rather long list of “could be”. For one more could be, check the electric plug on the MAF (Mass Air Flow) sensor on the the large black intake tube just after the air filter. Disconnect that electric plug and put it back on to see if that makes a difference.
If the check engine light is on, get it read at an auto parts store (free) and bring the codes here for advice.