Hi @karenje
Most likely the problem is with the [https://www.ebay.com/itm/114882375047|timer] (supplier example only). The heater circuit is also affected by the operation of the timer contacts.
Here's the [https://www.pwslaundry.com/files/docs/maytag-whirlpool/Service-and-Wiring-8528190-Rev-B.pdf|wiring diagram] for the dryer, so you can test if the timer and heater circuits are OK or not.
If the timer is faulty search online for ''WP3979617'' to find suppliers that suit you best. Here's a [https://www.youtube.com/watch?v=4hNcf3mpVmc|video] that shows how to replace the timer that may help