The brief
The 523i had got hard to start, the crank taking longer than it should, and a couple of times it had stalled shortly after firing up or at low speed. There was a power dip under acceleration, a fuel smell in the cabin, the fuel gauge had started reading erratically, and a whine had developed from near the tank. He brought it in. That whole list points at the fuel pump. The pump sits inside the tank and pushes petrol up to the engine at a set pressure. As it weakens it can't build pressure quickly on a cold start, which is the long crank, and it can't hold it steady, which is the stalling and the power dip. The whine is the pump's bearings wearing, the erratic gauge is the sender on the same module, and a tired seal at the top of the module lets vapour escape, which is the smell. A pump giving you all of that has run its course.
The diagnosis
A pressure test confirmed the in-tank pump wasn't holding rated pressure under load, and the whine and the erratic gauge lined up with wear in the pump module. The fuel filter checked out clean, so it wasn't a restriction. That's a replacement, not something you nurse along. A weak fuel pump only gets weaker, and the next step is the no-start on the driveway, so it was getting changed now.
The work
System pressure was released, the access hatch over the tank reached, and the failed pump module drawn out. A new genuine BMW-spec pump assembly went in with a fresh seal ring, the module locked down so the top sealed clean. Then the system was primed, the engine started, and the fuel pressure read on the gauge across idle and load to confirm it was holding spec, before the trim went back. A road test confirmed it started cleanly, idled steady, the power was back and there was no smell in the cabin.
The outcome
No fuel smell, a normal half-second crank, no stalling, full power under acceleration, and the fuel gauge reading steady. The 523i went home running cleanly. A failing fuel pump gets steadily worse and then strands you with no warning, so acting on the long cranks and the smell meant a planned fix in the workshop rather than a tow off the side of the road.