What is the best way to design an emergency button circuit?
It depends what the "emergency button" does and what the emergency might be. If it is something that is deigned to halt a life threatening situation, like someone getting caught in power machinery then relying on software of any kind is a seriously bad idea. That is what Big Red Buttons that cut power directly are for.
Levers and mechanical breakers are vastly more reliable than any computer or electronics. As any lawyer will likely tell you in court if your system fails.