96 ford ranger starting problem?

I have a 96 Ford Ranger 4.0L 6cyl. Manual. It just started having this problem. It starts up good and runs good. After driving awhile and i go into a store and come back out to start it… It starts up then acts like it wants to die, i press the gass and put it into gear and drive, after that its good until i stop it again. Any ideas?

Likely a fuel pump with a bad check valve or a weak fuel pump. Have the fuel pump checked with a fuel pressure tester. Fuel pressure must be checked with the engine running and immediately after shutdown.

Bad air idle speed motor its a silver round thing about the size of a pillbottle located on the side of the intake manifold