One of the best tools your iPhone offers to help you avoid distractions is Focus, which lets you control which alerts arrive at what times. It includes default modes like Work, Personal, Sleep and more, as well as the ability to create your own. For example, you might want to silence social media notifications while still getting pings for incoming messages from family members.
To select a Focus mode, swipe down from the top-right of the screen to open Control Center, then tap the Focus panel and select the desired mode from there. To configure your Focus modes, go to Settings, scroll down to Focus, then select any option (or create your own) to tweak what's permitted and what's silenced.
While Focus has been around for several years, some of iOS 27's improvements include tweaks to the feature. If you haven't updated yet, this is another great reason to do so.