2000 Nissan Maxima shuts off after idling

When I stop sometimes at a stop light or the car is idling for a little while it will shut off, What could be the problem?

A bad idle air control valve or dirty throttle body could cause that. A vacuum leak is another possibility.