Dryer shuts down just before cooldown

Dryer will dry two or three loads and then shuts down in mid cycle then I have to wait about 30 min. before it will restart. I checked the exhaust vent and it is clear. I looked inside and saw nothing unusual, could this be the thermostat?? I figure if it’s the fuse it wouldn’t come back on.