Exiting a screen, process or application could cause a catastrophic (unrecoverable) loss of data, or a break in the session.
Present a modal dialogue which delays the user from exiting immediately (the app or function is kept open in the background), informs them of the consequences of exiting (loss of data) and requires them to make choices, at least confirm exit or return to session.
Build systems to prevent data loss even if exiting occurs. For example, auto-save all user entry, save draft messages, etc. In many cases, even critical entry systems may forgo an Exit Guard as long as recovery is simple and the process may be easily re-initiated.
For high security or time-sensitive entry, such as banking, it may be implausible to auto-save information with sufficient security, or a break in the session may cause too much delay. In these cases, an explicit Exit Guard is useful.
The most typical variant is a simple modal dialogue, informing the user of the risk of exiting, and presenting a choice to exit or return to the previous state.
Sometimes, additional options may also be presented. These are usually special exit conditions, such as choosing to exit with or without saving.
A variant uses the Wait Indicator and a delay timer to provide one-click exiting, as long as the user is willing to wait a short time. For immediate exit, an "Exit now" button can be selected.
A sub-variant of the timer, used for high criticality applications, reverses the process. The user must select to exit in a short time (or continue pressing the exit button for a designated time period) or the process will not terminate and will return to the last state.
buzz when presented or they might not notice...
When the delay timer is configured so the user must continue an action, a dialogue must appear as soon as the exit function is selected, to inform the user how to exit. If used in the condition where a function must be continuously pressed for a certain time to exit, state how long, and provide a countdown so the user knows how much longer they have. If the button is released before the time required to exit, the dialogue should remain on the screen for several seconds so the first time user, more familiar with short presses and taps, has a chance to learn the process.