iPhone users have a options for Do Not Disturb mode, ensuring that only the important stuff gets through. Head to Settings > Do Not Disturb to customize it. In particular, you'll probably want to adjust the following options:
Scheduled: Turn this on, and set it to whenever you go to bed and wake up. Notifications will still appear on the lock screen. If you'd prefer to hide them from the lock screen as well, turn the Bedtime switch on that way, they'll only appear when you drag down the Notification Center, rather than tempting you to answer emails at 10 p.m.
Allow Calls From: By default, your iPhone will silence all calls when Do Not Disturb is on. With this setting, though, you can allow calls from your Favorite contacts, like your spouse or parents. Also, consider turning on Repeated Calls, too, which will allow calls through if it's an emergency and the same person calls twice within three minutes.
Those are the crucial ones, though there are a few other handy settings in this menu, like auto-replying to text messages while you're driving.
If you enabled the Allow Calls From setting, you'll need to add contacts to your Favorites group. Open the iPhone's Contacts app, tap on the person in question, and scroll down to Add to Favorites. Once you have the right people on your Favorites list and the above settings enabled, they'll be able to call you even when Do Not Disturb is on.
On Android Phones
If your phone runs Google's Android operating system, the Do Not Disturb settings may lay out a bit differently depending on which phone you use. But here's the gist of how they work, which should point you in the right direction.
First, open the Settings app and head to Sound > Do Not Disturb. From here, you can customize a few aspects of the feature, including:
Sound, vibration, and visuals: You probably want audible notifications turned off when Do Not Disturb is on, but you can allow your phone to continue lighting up when notifications come through though I imagine most people would prefer to have this off.
Exceptions: This is the really useful part. Here, you can choose to allow calls or messages (or both) from your "starred" contacts, even when Do Not Disturb is on. This allows you to block most notifications but allow those from your spouse, mother or other important people. You can also allow "repeat callers" so that if someone calls you twice within 15 minutes as would be common in emergency situations it bypasses Do Not Disturb.
Schedule: Finally, this is where you can schedule Do Not Disturb to automatically turn on and off at specific times, like when you go to bed. You'll absolutely want to enable this.
I highly recommend turning on an exception for repeat calls and starred contacts, letting you block most notifications in Do Not Disturb mode but allowing the ones you know won't be sent unless they're urgent or important. If you do that, make sure to star the right contacts in Android's Contacts app just tap on a contact to bring up their info, and tap the star in the upper right corner to mark them as important.
With these settings in place, you can feel much better about using Do Not Disturb liberally not just at night, but during meetings, date night and whenever else you don't want to bothered.