Defective Lid Switch
Inspect the lid switch on your Whirlpool dryer if you're experiencing problems with the dryer periodically turning off. If the lid switch goes bad, it can interfere with the normal operation of your dryer and even cause it to turn itself off. This small latch is usually found on the interior frame of the door. It securely fastens the door closed when the dryer is on to prevent you from accidentally putting your hand inside when it's tumbling and getting injured. However, if the latch is broken, the rotation of the drum might cause the dryer door to open slightly, just enough to trigger the lid switch's sensor to turn off the appliance. Swap out the defective switch with a new one.
A Whirlpool clothes dryer has a thermal cutoff. It's basically a small plastic fuse that trips to protect the dryer if it overheats. When it trips, it shuts off power to the dryer. Although you might be able to restart the dryer, it won't function completely unless the fuse is replaced; it can't be reset. Before you replace the thermal cutoff, determine what might have caused the dryer to overheat.
Check to see if both of your Whirlpool clothes dryer's two circuit breakers or fuses have activated. Your dryer works off two circuit breakers and fuses: one for the heating element and one for the drum. If they're tripped or blown, a power surge caused by an electrical storm might have entered the home, prompting the components to turn off the dryer to prevent the electrical current from short-circuiting it and causing a fire. The circuit breakers and fuses are designed to act as stopgaps that protect your dryer from power disruptions that can damage it. Reset the circuit breakers to restart the dryer. Unfortunately, if your dryer works off fuses, they'll need to be replaced to turn your dryer back on.
Faulty Home Wiring
If your Whirlpool clothes dryer repeatedly turns off in the middle of a dry cycle, the problem might be caused by faulty wiring. If your home's main electrical wire connection corrodes or fails, it can disrupt the power supplied to various electrical outlets, including the dryer's outlet. Damage to the main electrical wire connection can spread and affect certain electrical outlets, including the dryer's outlet, causing it to also fail. Contact a certified electrician to inspect your home's wiring for flaws. Depending on the extent of the electrical damage, he might recommend that you replace the dryer's electrical outlet and terminal block, as well as the power cord.