2000 Ford Focus periodocally wont start

Hi



I have a 2000 Ford Focus that periodically won’t start after it has been parked . It will turn over and as long as I keep my foot on the pedal for gas it will stay running but when I take my foot off it will die . But it will restart and do the same thing . If I let it set for 20 - 30 minutes it will start and am able to drive it

Is there anyone that can help me with this problem .



Thank You

Gary