DMing: Planning vs Organic
As Matt mentioned there are many ways to plan a RPG session, but most fall under two categories. The Architect method of thorough planning and the Gardening method of allowing the story to come organically. Both have there merits but ultimately it depends on the Gamemaster's, or GM's, creativity, charisma, and eloquence. Granted serious planning should go into all sessions but eventually you come to the point of how much/what do I plan next.
Many good GMs use one or the other, but a great GM will find the middle ground that will suit their skill and play style. One should develop the mentality to heavily plan but possess the flexibility to improvise. Knowing what to plan is also important. Many GMs will put time and effort into planning HOW their players will get to specific moments or encounters only to have the players avoid moving forward, miss the cue or hint you casually drop entirely, or under appreciate the carefully crafted dialogue. No matter how well you plan you cannot always anticipate what your players will do or how frustrating they can be. Instead of breaking down, railroading your players, or calling the session early, try to find organic ways to incorporate your plot points, dialogue, and NPCs into the path your players are now on.
Planning should involve that which will not change. Names, places, descriptions, relations/opinions, key dialogue, plot points, etc. The more effort put into these areas allows for more organic play later for the players. Plan your world, continents, region, city, village, or dark cave encounter so well that no matter what your players do they will never catch you unawares. The important part is not how your players get to the encounter, but the encounter itself.
Hopefully this advice will come in handy and thanks for reading.