If it shuts off while idling at a light the most probable cause would be a dirty throttle body.