Fuel pumps that are failing sometimes will do that, does it start everytime you try it? Need more info on your problem. There is a relay bypass thread that might be of service to you..it will let your pump run so you can determine that area. Fuel system is rather simple..not too many technical components.
Some issues that cause your symptoms:
Poorly functioning fuel pressure regulator (not common)
Plugged egr tube or valve body (cars equipped with 4eat only)
Egr vacuum solenoid/switch (4eat only)
Cam position sensor
Crank position sensor
Fuel pump relay (you said it works)
fuel pump (complete failure could take time)
Etc.....there are people here that can chime in that know more.