Truck goes dead when in neutral but will stay on in gear

Yesterday my truck would stay on if I had the gas on, or if I put it in gear and drove but when it was in neutral it would shut off. And then after driving it for a few minutes it completely shut down. It is a manual transmission.

So now it won’t start? Will the starter crank the engine?

make? model? engine? year? miles?

“I had the gas on” ? what does this mean

A clogged/faulty idle air control valve (IACV) can cause rough running/stalling at idle, but usually doesn’t “completely shut down” an engine.

Clean IAC and throttle body. Also, when was the last time the plugs and wires replaced?