2006 Toyota Corolla - fuel pump, ECM, or ghost in the machine?

I really hope someone here could help shed some light on a problem going on with my husband’s 2006 manual transmission Toyota Corolla S. I’ll try and keep a very long story as short as possible!

The problem began a year ago when the car would randomly lose power while hubby was driving it, and then regain power almost immediately and continue to move forward. Weird. Fast forward a year and the problem is happening more frequently. Couple that with the car taking a lonnnnng time to start up in the morning. One day, it ceases to start altogether. Had a mechanic friend of ours look at it and tell us we need a new fuel pump. Okay, no problem. We paid him for the pump and he installed it. Before I could dance a victory dance, though, as hubby turned the key…the car still won’t start. Mechanic buddy takes another look at the car and said the ECM is cracked and needs replacement. Looked it up online and ECM is covered under safety recall. Had car towed to the dealership, waited 2 weeks on ECM replacement, dealer called us up to let us know that…the car still won’t start, and looks like we need a new fuel pump. (???) OK, I know you are probably wondering why, at this point, we didn’t just let the dealership deal with it, but we didn’t. Mechanic friend took another look at it and said it looks like a bad connection between the pump and made an adjustment to it. Yay, the car works! Sort of. Car starts acting funny again. We’re driving along and the car is losing/gaining/losing/gaining power, tachometer goes up and down, we hear a funny clicking coming from the dash area every time the car loses power. Last night, the car just refused to start. This morning, it started. After several attempts. Made that fun “verr-verr-verr-verr-verr-verr” sound without the “-rooom” at the end. Since my knowledge of fuel pumps and their casings, ECMs, and the like are limited to this situation, I’d love to know what’s REALLY going on with the car. I have a suspicion that it goes beyond the fuel pump situation, but mechanic friend thinks it is the casing or something like that. I’m just wondering if any car experts on the forum could give their insight into what you think might be going on with this seemingly possessed car before I go nuts trying to carpool everywhere with the hubby!

In the engine compartment, just behind the battery is a narrow black box with a removable cover. Remove the cover (push in the tab at the front) and you will see some fuses and relays. The underside of the cover has a diagram identifying each of them.

The relay in question is the fuel injection relay. If the engine will run, see if this relay is the source of the clicking sound you hear. If it is, then you need a new one. A new one from Toyota is about $100. From Advance Auto or O’Riellys, they are about $15.

Thanks, Keith!! When the engine runs, it sounds smooth. The only time that clicking noise happened was a couple days ago when the car kept losing power while in motion. I’ll definitely have that looked into.

FYI, that relay provides power to the fuel pump. All the other manufacturers refer to it as the “fuel pump relay”.

If we are able to get the car started again and it’s idling smoothly in the driveway, is there a way to test out the fuel injection relay to see if it is working?