Set the right timing for dialogs
Modal dialogs are the best option for delivering critical information that requires immediate user attention. They're urgent and interrupt what users are doing, forcing them to step back from their current task and take action.
However, designers should be careful of timing and avoid modal dialogs interrupting high-stakes processes such as checkout flows. If there's no valid reason for modal dialogs, users can get easily distracted or lose their confidence.
We can also use modals when the requested information can significantly reduce the work or effort put in by users. Asking users to log in or sign up during the checkout won't help them complete their purchases faster because they may need to remember their credentials and enter them. If they fail to log in or consider the signup tool complicated, you'll lose them.[1]
Pro Tip: If you want to deliver information that's not relevant to the current flow (e.g., a suggestion to sign up for an email newsletter), non-modal dialogs are a safe bet.
References
- Modal & Nonmodal Dialogs: When (& When Not) to Use Them | Nielsen Norman Group

