Is it my fuel pump or main relay?

My car sometimes dies out while driving and won't start but after I let it set for awhile it ll start. It also does it sometimes when I make a quick stop to a store. It's not every time I drive it. When this happens, the check engine light comes on and the fuel pump doesn't kick on and the main relay doesn't click. I've been having this problem for almost a year and the mechanics can't seem to figure it out.
Does it sound like the fuel pump or main relay?
Will the main relay stop working if the pump is bad?
It's a 1998 Honda Civic LX

Relay