05 JEEP TECH QUESTION

This a long one. Ill try to make it short as possible. I have a 05 jeep g. cherokee 5.7 In November it started no starting & i noticed i couldnt hear the fuel pump. It would only do it once in awhile. So i changed the fuel pump relay & fuse. It was fine for a few weeks then back to not starting. At that time i noticed my battery was going bad & i was told the pump wasnt getting enough volts. I then had the alternator tested & it was bad. I replaced battery & alternator. Again it was fine for a few weeks. This was all it or miss. It might start for a few days or a few weeks. Again i knew when it wasnt going to start because i couldnt hear the pump. I replaced the relay & fuse again. Once again it was fine for a few weeks. At the end of December i replaced the fuel pump. It was good until April. Back to not starting. I replaced the fuse & switched the relay with another one from in the fuse box. Fine for a week. I went to visit my mom the other day. I visited for a few hours. It wouldnt start. I switched the fuse & relay from others in the fuse box & nothing. I went in sat down for about 10 minutes. Went out & it started & it idled really ruff for about 5 seconds & shut off. Havent been able to start it since. Im lost. If its electrical im screwed lol When it comes to wiring testing & checking i am a dumb ***. lol Sorry so long. Thanks