The dryer door switch can be used to detect whether the door is open or closed. If the door is open the dryer won't start. If the switch reads that the door is open when it's shut, then replace it.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.