Knowing the truth, which is that nothing matters, can actually save you. Once you get through that terrifying threshold of accepting that, then every place is the centre of the universe, and every moment is the most important moment, and everything is the meaning of life.
—  Dan Harmon, creator of Community and co-creator of Rick and Morty.

I hate to compare DnD to sex again, but good DnD is like sex: confidence helps, experience helps more, and constant apologies piss off your partner. If you maintain control of the table you will be better at keeping everyone involved and happy, and you will KEEP THE GAME MOVING. Side conversation is natural and jokes are great and technology can even add a lot to a campaign but left unchecked and not properly stimulated by the game, players can drift. The DM has to keep bringing it back to the game, to shut everyone up if necessary or to speed things up if things are slowing down. Cell phone and laptop use is generally harmless but distractions slow down the game and bum everyone out. The key is MODERATION, a truth about as interesting as the very concept of MODERATION.

While distractions can be problematic – and while breaking immersion and momentum is inevitable – the natural overcorrection can be equally dangerous. Constantly demanding attention and setting rules to limit technology is a quick way to look like a huge asshole, and trying not to look like a huge asshole is a big part of being a DM (and a human). There are respectful and disrespectful ways to bring up issues, to try and get back on topic, to shut down a rules lawyer, etc., and the words the DM chooses to handle it are very important. If you’re at odds with your player group they will have less of a reason to listen to you and more reason to stop paying attention and text a friend, or to try and get some laughs from the table. Also they’re probably your friends … so own the table, but don’t be a dick about it.

5 Ways Your Dungeon Master Can Ruin Any D&D Session