The 5.4's had an issue with the fuel pump control, located on the frame crossmember forward of the spare tire.
Its housing was made of aluminum, and being in contact with the steel crossmember would cause a cathodic reaction, which would mean the housing would fall apart (literally turn to dust/bauxite), and the circuitry would fail due to moisture/contamination.
Have a look under the truck, and see if that housing looks like this:
I bought a replacement (Amazon) for around $100. Easy to change, problem solved.
The new ones come with standoffs, that electrically isolate the housing from the frame:
Disclaimer: The part number required for your specific application may not match the part number in the picture!