My suggestions:
1) Never fall in love with any plot point, location, or NPC.
Players almost always zig when you expect them to zag. They'll negotiate with monsters you expect them to fight. They'll piss off NPCs you expect them to want to help. Let them do this. ENCOURAGE them to do this.
The best way to keep them from "going off the rails" is to think of the rails as chalk drawings on the ground that can easily be stepped over anyway.
"Following the book" completely negates the whole purpose of having a human GM there. You can play a computer game or read a book to have the whole story plotted out beforehand and the players just go through the motions. Embrace the fact that it's YOUR world, not the book's, and run with it! And as a corollary...
2) Never prep more than one or two sessions in advance.
You can have a general outline of where you expect things to go, and certainly feel free to drop in clues or foreshadowing if it pleases you. But don't waste a lot of time worrying about sessions that are far in the future and may not actually ever come. It is a sad fact of life that many game groups don't last more than a year before someone moves, or someone else has to drop the game because their life changes, or whatever.
The game happening TONIGHT is the one you need to worry about. Prep just as much as you need to make THIS session awesome. Then next week, do the same. Repeat until you run out of sessions.
3) You are the master, not the books.
If there's some problem down the road because players didn't pick up the Macguffin of Plot Point, that's a fault in the books, not in you or your players. But the great thing is, because you are in control, you can tell the book to bugger off and do what you want. The book says they can't Close the Portal of Doom without the Macguffin of Plot Point? Well the book is wrong. They can Close the Portal of Doom by smashing it with the fighter's magic hammer, or casting a custom spell the wizard can whip up with an Arcana check, or holding hands and using the Magic of Friendship, or whatever is cool.
Decide how they can close the Portal of Doom when doing the prep for the session that includes the Portal of Doom, and not before! See item 2) for details.
4) Kill the book and take its stuff.
Honestly? Most written adventures are pretty weak, even the best of them. This isn't a criticism– they have to be! The writer doesn't know your players, your GM style, your campaign world, etc. I used to write stuff for White Wolf back in the day, and the best I could do was write stuff that I thought would work at my table, then extrapolate to make it as generic as possible.
So any written adventure you get is going to be, at best, a series of guidelines. "This is how one writer thinks the adventure might go."
What they're really good for is ideas for NPCs (so you don't have to think up every person in the universe for your game), mechanically-sound encounters (hopefully), maps, and cool imagery. You'll be much better served by gutting the module, coming up with your own take on it, and then incorporating back in the parts from the written module you like.
It may sound like a lot of work, but remember that you're doing it one or two sessions at a time. You'll be fine!
5) Be lazy.
I highly recommend SlyFlourish's
The Lazy Dungeon Master for everyone, but particularly for people who feel locked-in to written adventures and are being stressed by it.

You can find it here:
http://slyflourish.com/lazydm/
Enjoy!
-The Gneech
