If you're on IOS, the Focus feature is great. I use it primarily for sleep to turn off all notifications except for calls (in case of emergencies). But you can basically configure multiple profiles with different notification settings. Also, whenever I install a new app on my phone, I turn notifications off unless it's a time sensitive app like a messaging app.
My work phone is an iPhone and I love this feature. The moment it's past work hours I no longer get buzzed for any notifications, and I only see direct messages on the home screen