Ford Escort dying

My 1998 Ford Escort makes a series of escalating tones, then dies. Let it set for 3-5 minutes and it will start and run perfectly (for awhile). Please help, I’m at my wit’s end.

Will it keep running if you have your foot on the accelerator pedal just a little?