Do Not Disturb mode has been around on iPhone since 2014. It’s a great way to turn of sounds and vibrations at night, but it’s pretty much an all-or-nothing solution. Yes, it can make exceptions for your Favorite contacts, but there are definitively situations where you would like something in between.
That is why you need Notification Levels.
When I get to work and need to focus, I set Do Not Disturb to 1, which will silence all notifications on level 1. In my case, these are from Facebook, other social media apps and all just-for-fun apps. Calls from numbers not in my contacts list is also blocked at this level.
And finally, when I go to sleep, I set it to 4, which will only let my family through.