I have learned a great deal since I started DMing at the very beginning of this year (2002). I have taught myself, been taught by my players, and even managed to teach my players a few things. I have run across a variety of situations in and out of the game that I have had to deal with. I started myself out on the DMing road, but not everyone has to set out without a compass. I'd like to pass on some things I have learned and/or come to believe.
DM because you want to: Many people start to DM because nobody else will take the job, which sounds like a bad way to start - but it doesn't have to be. Some people discover great enjoyment in the DM's chair and would rather stay in it, and others grow to enjoy the role with time. If you give DMing a good, fair try (for at least three sessions, I should say) and you like it, by all means continue. But if you're not comfortable with it or worse still, loathe it, don't force yourself to continue. Likewise, if you have been DMing for a long time and can't stand it any more, take a break; the game will only get worse for everyone if you hate it. If your players complain, tell them politely that you are on hiatus and that if they would like to try DMing, you would be glad to play (if indeed you feel like it).
DM only as much as you want to: If you want or need to take some time off, do it. While you want your game to be consistent, hopefully you have a life and there will be times when you will want to do something else. Set a comfortable pace for yourself that allows for the rest of your schedule. If you can't run as much as your players want, that's all right; ideally, they should always be left wanting more. Take time for yourself during the game, as well. Eat if you're hungry, or call for a time-out if you want to stretch your legs.
Acquire the books that you will need: Some people go all out when they try something, and they buy every product available. But what happens if you try it and don't like it? For a new DM, I would suggest sticking to the core books (the Player's Handbook, the Dungeon Master Guide, and the Monster Manual respectively). If you want to use a setting like the Forgotten Realms, you will want to have the book required. The books can cost a fair amount of money. If you like DMing and want to expand your library, gather your cash and go for it - but give yourself a trial run. If your friends and/or players have books you would like to see, ask them if you could borrow them. See if they will be of use to you. (I have benefitted from the generosity of my players in this regard.)
Beware of the details: DMs should develop good plots and engaging encounters. It will take some work and some time. But don't slave for hours if you don't need to. Develop your own system for making things easier on yourself. Most gamers have school, work and other things to tend in their lives. Gaming preparation should only take up so much time. Only make NPCs from scratch if they are going to be important (all major villains should be customized for maximum effect). Use the charts available in the DMG for your assorted-variety NPCs. Write down what you will need so you don't have to flip through the books. Write out encounter sheets beforehand (listing the character names and the enemy so that you can write down initiative scores and get right to the fight). Keep it short, sweet and to the point.
Develop the game for everyone: Examine your players. Find out what they like to experience in a game. Do they like gold? Does one like magical items? Does another player like intrigue? Do your players like combat once in a while? Do they like the nuances of travel? Try to weave into your game the elements that your players enjoy, and spare some room for what you enjoy, as well. You will have to find a balance, so that everyone gets a little bit of what they like. It will make the experience more pleasant and the game easier to run if you include yourself in the equation.
Consider the possibilities: Try to make your world more than a clear-cut divide between lawful good and chaotic evil. Try to add the other parts of the spectrum. Not all good folks want laws. Not all evil folks go around slaughtering everyone in sight for shits and giggles. Have a look at my work on city alignments to get an idea of what I mean. Your players will be kept on their toes, and your setting will become all the richer for the shades of gray.
Make enemies interesting: Try to pick a variety of enemies. Chances are, you will make choices that will throw your players off. You will be able to surprise them. Try to make enemies of monsters as well as of characters with actual character classes. Keep in mind the natural abilities of the enemies and work them into combat tactics. I gave my group a run for their money with a group of araneas (spellcasting and webbing; it was bitch to get to them) as well as with rogue/rangers who really meant to kill them (one was going to coup de grace an unconscious player character and the group freaked). Take the intelligence and intent of th enemies into account. Show your players that their characters aren't the only ones who can think and strategize.
Experiment CAREFULLY with the rules: Everyone has some rule or other that they don't like. If something doesn't suit you, you can try to change it. Be aware that you endanger the balance of the game when you alter things. Try to balance your changes as much as possible. Playtest your changes and admit if they don't work. It seems like every DM has some sort of house rule. I have quite a few. I changed the experience and the treasure because I felt 3E gave out too much. My game is set up to take longer. I still reward the players, however. In my game, all cure/harm magics have the maximum effect; a cure light wounds will always cure the maximum amount (based on the minimum cleric level to make the potion). To balance that boon, I simply took the idea all the way home: all cure/harm magics are at maximum, even for enemies. Be especially careful when creating new classes or monsters. Those things are easily overbalanced.
Play around with roles: People have learned certain patterns in fantasy movies and books. The women get kidnapped. The men go to rescue them. The villain always acts like a villain. Sometimes you can alter small things in the scheme and make it feel new. Instead of the bandits kidnapping the noble's daughter, perhaps she blackmails the leader of the bandits and in essence "steals" them. Perhaps the woman who begs for protection isn't a victim but a cold-blooded killer. Perhaps a man is kidnapped.
Take care with NPCs: I would recommend that you not have your own player character in the game, as you will be inclined to favor yourself. I have seen DM player characters cause deep resentment and strife. Stay away from God PCs. On the other side of the coin, carefully balance your non player characters. Make them into people. Give them quirks, troubles and lives. While some NPCs will have great power, you should try not to make them all-powerful. Everyone has a weakness. Don't forget to include the common folk, too. Who knows how the shoemaker will fit into things?
Develop a DM persona: An effective DM needs to be patient, even-handed, polite and firm. These are not traits that people tend to exhibit all day long (you should see me on the drive home!). They are traits that you should strive for while you DM. Put yourself in a DMing mood. If your players start to give you trouble, take a deep breath before addressing them. Listen to the concerns of your players for a time (you may want to put rule arguments on hold until after the session) but know when to say enough is enough. You will have to teach yourself how to be firm if you don't already know how. You will have to make your decisions in your best judgment and be willing to stand by them. It may be difficult if you are not used to standing up for yourself. It may also be troublesome if your significant other or close friends are in the game. You will have to strive not to pick favorites. You will have to examine your own conduct for fairness. You will have to keep your temper in check. If you are fair most players will respect you, even when they disagree with you.
Don't take shit: Some players are belligerent and rude. Some players want everything their way and they will argue with you if you cross them. Some players just want to take advantage and will test their limits with you at every turn. If a player is rude once or twice, it's understandable. Try to speak to a player about any problems you may have, so that they can have the opportunity to correct their behavior. If a player is constantly nitpicking, bickering and complaining, apply your foot to the floor (or, in some people's cases, to the ass). If a player simply will not listen or comply with reasonable requests, do not waste your time on them. Ask them to leave. If you are holding the game in their house, find some other place for it. Let your players know that you will not stand for being bullied or cornered. Be polite, mind you. You don't even need to raise your voice. Draw your line in the sand and defend it (with words, people, not violence).
Don't be a bully: It is easy to take advantage of your position. You will have to tell people what to do sometimes, just in being a DM. Some DMs go overboard, however, and they start bossing people around all of the time. They set the game up as God vs. Players and get nasty if they don't always win. If you're going to bother with DMing, don't be an asshole. You'll have the ultimate power of creation. You do not need to yell at your players. You do not need to be rude in your rulings. You do not need to make a perfectly enjoyable hobby into a pit of resentment.
Minimize distractions: A lot of gamers have cell phones, pagers and other electronic tracking devices. You will be trying to draw your players into a fantasy world. You will not be able to do that as well if your players are answering their phones throughout the game. Do not be afraid to ask them to turn their equipment off if it distracts you or other players. Do not be afraid to ask them to stop socializing out of character. Do not be afraid to ask them to pay attention. While it is nice for the players to share a joke or two, it is not acceptable for them to speak while you are trying to DM. It is not acceptable for them to read while you are trying to DM. Sometimes, a little reading is necessary so a player can plot out a movement. Once their curiosity is satisfied, however, they should put the book down. (Do you remember your old teachers telling you it was rude to speak/read while they were teaching? You will understand why as a DM.)
Bring the players together: Different houses will require different gaming group arrangements. Some houses are quite small (like mine). Try to center your players in a circle of some kind, or at a table. While they probably won't want to be in each other's laps, it is good for them to be at situated not far from each other. Keeping the players centered together helps on multiple levels (distractions, cheating, chemistry).
Nip potential cheating in the bud: Take a look at your player's character sheets from time to time, if you don't keep them with you. Make sure their stats are correct. Some players will forget a point here or mistakenly add points. You don't have to think of your players as cheaters, but you never know when a cheater will show up. You can avoid problems by having a look and keeping all player rolls public. Some players like to tuck themselves in corners and roll away from other people's eyes. Secrecy can lead to cheating, and cheating can make other players mad. If you don't play at a table, find a place for everyone to roll and make it a central location between your players. I instituted The Box, which has been either a wide shoe box or a box top from a cardboard box. Level surfaces with sides can really help. On another note, try to read up on the spells and stuff that characters are using. Some people misread spells and use equipment incorrectly. Other players deliberately misuse things, so try to keep yourself informed.
Deal with cheating calmly if you can: Many people get pissed off at cheaters, regardless of the forum they are found in. Some people cannot restrain themselves from being rude to cheaters. The problem is that many games are composed of friends. If you find out a friend is cheating, you may not want to foam at the mouth when you tell them to leave. You certainly don't want to ruin relationships because of a game. If you have to take a moment to gather your calm, do so. It is up to you if you want to give a cheater a second chance. It is up to you to accept reports of cheating from your other players. If you see it yourself, at least there is no doubt. You may want to develop a policy and tell your players about it. If you have a zero tolerance cheating policy and you inform your players at the start of a campaign, they will know the consequences they face by cheating.
Discourage metagaming: Some players have the annoying habit of reading the Monster Manual and reciting the stats of monsters as they show up. Suddenly, the whole group is let in on the weaknesses of the enemy you have just conjured. Keep in mind that some players have DMed and thus needed to know a lot about the game. Politely ask that players not speak in gamespeak if at all possible. Try to name magical weapons so that a player doesn't always go around saying things like: "I draw my +1 sword." Ask your players to try to stay in character, and correct them until they comply.
Don't let out of character information in: Other players have a nasty habit of bringing out of character knowledge into the game. Say Devan the Gamer Geek knows all about the monsters in the MM. He's read the whole book cover to cover. Now, if he's playing Nav'Ed, a first level bard, his character probably won't know too much. If Nav'Ed and his group bump into a troll for the first time, the characters probably won't know about the extent of its regeneration and its weakness to fire. Let's say Devan says: "Oh, it's a troll. My character grabs his flask of oil." You have every right to stop him. How the hell would his character know about that? Players like Devan bring out of character knowledge into their character. The point of the game is to play a character and to experience the limits of that character. Make it clear to your players that while you are glad that they are so well-versed, their characters probably do not know as much. If they start using knowledge that their character doesn't have access to, they're going to get called on it. Make them change their actions to suit what their character knows.
Allow for some mistakes: You are only human and you are going to make mistakes. You are going to forget things. Try to know as much as you can, but if you find a mistake, fix it. Apologize nicely and fix it so the game can move on. Allow your players to gently correct you when you are wrong (but make sure they're right). Sometimes they will see things that you will miss.