DM word is law, but only as far as the rules go.
be prepared to wing it when they go off track. Take short notes when you do, so you can work in that direction when preparing next session.
accept that you will screw up alot of things at first.
It helps to have 1 player that has alot of experience, when there's that 1 little rule you can't remember, they can help you in that case. However, don't forget DM's word is still law in the end.
Be consistent when making calls on how to interpret certain rules.
Try and get some background music that fits. Merry music for fairs, rowdy stuff for inns, sinister stuff (like the Witcher music CD) for dark plots & dungeons. And dare to dim the lights and just use tealights for instance.
Also, if it gets to distracted, be sure to allow for a little break. 1 big break is better for everybody to go to the bathroom, smoke, get something from the car, ...
Try to tailor the campaign a bit to the player's preferred playstyle... More diplomacy, more puzzle solving, more hack & slash, more casual social roleplaying, ...
Try to make sure you get somewhat of a balanced party, without forcing anybody to play soemthing against their will. (if your player-group low on healing, allow for a more generous source of healing potions for instance)
If you want them focused, try a timed event too.
Like a puzzle they need to figure out, but set a timer on the table that actually counts down.
Try to get somebody in the party to keep a journal, or make maps of where you're going. (I had at one point a Kender who's character sheet was about 30 pages with maps, drawn in true Kender-style
And I found everything with it, even if it was unorthodox writing).
And also, something I always thought was very good, but have yet to try in practice: *warm up* your players. Like little stupid exercices of imagining things, or describing a fantasy that has nothing to do with the setting, just to get that creative juice flowing.
And as a final note... If you're starting off as a DM, try to simply go for a few store-bought campaigns... They're professionally prepared, fleshed out npcs, good story-line, and if for some reason the players don't take the bait, you can try and inject a second storyline in there without too much hassle.
That way, you can get a feel for it, and if you pick adventures that only last 3-4 sessions, it lets your players get comfortable with eachother, and give you some headstart towards fleshing out your own completely custom campaign, while working in everything you learn from these first "trial-runs".