Car won't start

I have a 1997 Pontiac sunfire the other week I was driving and it stopped on me the engine would crank but quickly turn off but everything inside the car would still be on k was told I needed a new cat and got that and a new muffler put on. This morning I went to leave for work and the same thing happened again! I was told it could be the fuel pump or fuel filter but it doesn’t act weird while driving it. What could this be?

Duplicate post.