Whirlpool dryer won't stay hot

My Dryer starts to heat but then blows cold air. I hear a kind of rattling noise when it is trying to reignite the burner. If I let the machine rest for 15-20 minutes it willl start up again (provide heat that is) but then fade again as well. Cycle doesn’t matter and I tested the thermostats with my ohm meter and they seem fine.