1998 chevy metro that dies at idle

I just bought a used 98 chevy metro. I drove it over a total of 30 miles on test drives. Every thing was as it should be. Now it dies at idle and is difficult to restart. I have to wait til it cools down completely to get it to fire again. Any ideas?

The problem might be with a dirty/defective Idle Air Control valve.

The IAC valve allows the engine to idle anytime the accelerator is released. One way to check if this is the problem is, when you know the engine is about to stall, with your left foot on the brake pedal slightly step on the accelerator. If this prevents the engine from stalling the problem is with the IAC valve.

Tester