need help,car dies,then starts right back up

there if one for the key but dealer said that would not cause the problem i am having