Set up Do Not Disturb mode
Are you using the Do Not Disturb feature? It's perfect for insulating you from distractions where you're trying to work, or get some sleep.
Do Not Disturb can be activated from the Control Centre; swipe upwards from the Home screen (or from within apps, if you've allowed that feature) and tap the crescent moon icon in the top row of options. A matching moon icon will then appear in the top bar of your iPhone screen. (Can we take a moment to appreciate how elegantly this top icon 'waxes' and 'wanes' when switched on and off?) With Do Not Disturb activated, incoming calls and alerts will be silenced.
This is the simple, manual method for activating Do Not Disturb, but we can get more sophisticated than that. Go to Settings > Do Not Disturb (in the second bank of options), and you'll see a range of options, including the ability (under the label Scheduled) to set 'quiet hours' each day or night.