Stop using it
The door switch has failed. Stop using it.
The door switch is supposed to cut power to the motor the moment the door opens. One that has stuck closed lets the drum keep turning with the door open, and hot air pours into the room. That is a hazard for hands, kids and pets. Switch the dryer off at the breaker or unplug it, and leave it off until the switch is replaced.
It usually turns out to be one of these
- door switch
- control board

