Are there any warning signs before it gives up, like a spluttering? Does it only happen at idle, it is only just after startup, does it only happen after you accelerate hard?
Several things could affect it. A dirty MAFS, faulty SCV, air leak on the suction side of the pump (anywhere from pump to tank but most likely a mispositioned seal in the fuel filter or a deteriorating hose/overtightened clamp). It could be a faulty fuel rail pressure sensor, glow plug relay, loose injector harness - there's more, but some more info might point us closer.
If you want to clean the MAFS do it carefully and use an electrical contact cleaner, do NOT touch the inners with tools, cloths, cotton buds etc. You could clean it with a solvent, I'd recommend either methanol/ethanol or at worst unleaded petrol. A broken MAFS costs around $400 - it's in the back of the air pipe just outside the air filter and it reads the flow rate and temperature of the incoming air.
The SCV - suction control valve - bolts onto the back of the fuel pump (mounted on the right hand side of the engine, low down). I think it's a couple of hundred bucks and about an hour's work to change.