What is the function of the safety door and emergency stop switch in a machine?

How can a user check if the safety door or emergency stop switch is on in a machine?

What is the purpose of the error code M7016-EMO&&DOOR in a machine, and what
The solution for the error described as M7016-EMO&&DOOR is on, is to check the safety door and emergency stop switch (X22). If either of these components is faulty, it can cause the error