Turn your notifications off!
You’re writing some code or aswering an email.
And then your coworker asks something in Slack. Now you think about this message. Even if you don’t act on it right now, your brain still starts to come up with an answer in the background.
Your attention is now split between the task you were doing and this message, and neither of them get your full attention they need.
Just turn off your notifications. And this includes these small red bubbles on your Mac’s dock.
You will occasionally check your communication channels (Slack, email etc) and answer these new messages.
And then you close these apps again to work on something else.