Advice to Newbies
Do not take the rules too seriously, change them (or in a players POV, ask the DM why?) to suit you.
I'd really have to tell them to learn the rules very well. In my first campaign none of us were too good on the rules and it was pretty rough playing. The DM made house rules, which is fine when you know the rules and don't like them, but when you don't know or under stand to begin with it really screws things up. I don't know, maybe I should put more emphasis on roleplay or something, but if you don't know the system you can't so anything.
Don't build anymore of your world than you have to and have some fun!
Never trust a smiling DM. Never.
KNOW THE RULES. Inside and out, read the rulebooks and learn the rules. *Then*, depart from them at will. but always know the rules. The rules are the only way that the players feel they have any control -- if you don't follow at least some rules, the players are just watching you narrate a story.
Modules are for wimps. Use them for ideas then throw them out and ad-lib, let the players make their own path, they will enjoy the game more. If your a new player joining a group of "experts" don't worry about the rules. You'll learn them as you go. Just enjoy the game and learn to role-play.
Be patient, make lots of plots, allow details as you play, don't get bogged down in story parts, and most of all have fun being something you are not!
Be creative. Be ready for the unexpected. And don't be afraid to make last second changes.
Daydream. Daydream about your characters, NPCs, magic items, places, events, etc., in your games. It'll give you all sorts of neat ideas and will help you prepare for the game.
Rules set a framework of fairness and the most basic rules of play should indeed be learned by all, but I think the rules should not be seen as constraints, and descriptive narration and impromptu PC actions and ideas go a LONG way to making a good night great.
It's all about fun, know the rules yes, but don't let a characters death or loss of a magic item ruin things for you. Try some adventures that are based almost entirely on roleplaying, it can be really rewarding for a change of pace.
A brand new DM should be very cautious of how many magical items are awarded. When just starting out be very hesitant to give any, almost to the point of being stingy, until you get a feel for the way magic changes the campaign. When magical devices are awarded, make them limited in power such as wands with charges, or scrolls, even potions which must be consumed are OK.
Don't be afraid of your group, or whether you area good story teller, or a master of the rules, or such. Most groups are in the game for a good time, and as long as they are enjoying themselves, who cares if it is a generic dungeon-crawl with some window-dressing, or a taut political thriller with subtle psychological clues and mystery. My stronger advice would be for the players under a new game master. Give the individual a chance, offer constructive advice, and don't be afraid to tell a new GM what you really enjoyed in a session. The encouragement of the group, and the latitude they give him or her will go a long way to shaping a great gamemaster.
Have the player start out small, and give a small special (item, ability, friend, whatever) in short intervals. Distribute power evenly among PCs. Don't have overpowered NPCs join the group for long.
Don't worry too much about learning everything there is to know, people will help you. Some 'older/more experienced' players here and there seem not to like 'newbie' players (and can be snobby when they don't know something about the game) - forget about them, everyone else is glad to have you along.
If you don't know, wing it. Make sure that there's always a larger back story going on so you have somewhere to go in the future. Most importantly remember that it really isn't a crime to kill a rules lawyer.
Get organized and be prepared for anything!
Have fun! Learn the rules (it helps!), but understand that everyone is out to have fun. The right combination of pre-planning and improvisation will make it an enjoyable time for all!
Do not whine at, insult or threaten the DM. If you allow yourself to be pushed around by the players, you will never be in control of your game.
Never lead the players were they don't want to go. Just because you know that it will lead to a (probably) fun adventure, it doesn't excuse making the players feel like actors directed by you. The freedom to choose your characters action is what sets roleplaying apart from other games. As for rules, find out what works for your group by trial and error, remember different players require different amount of rules.
When the DM smiles its already too late. Get involved and HAVE FUN!!!!
Never ever touch another player's dice without permission.
I would say that a good DM should know when to ignore the rules (which presumes that you know them)! "The GAME is the thing". I would also tell him to beware of evil PCs - IMO D&D is a social game and if the PCs are evil, the players will probably start fighting among themselves before too long! (Sad, but I've seen it a number of times)
To DM's, prepare your game and use a lot of imagination, and then just have fun. Also, be prepared to "ad lib" alot.
To players, spend a little time and create a background and personality for your character, and then have fun interacting with your group and the NPC's. Also, be as creative as you can with combat and spell use. The more unique and creative, the more fun you will have and the more memorable it will be.
The characters you'll play best are the ones you care about.
Be honest and truthful without being hurtful. Understand that the roleplaying sessions are different things for different people, and being comfortable with that. Some people just like to game, some like to role-play(act), some like to socialize and game, etc. No one style is better than the other. Respect each other and treat others as you like to be treated. Be interactive, both with other players and the GM(s). If there is something that you do not like, say something in a constructive manner. Try to deal with it, because otherwise it can turn bad, especially if no one else realizes how you feel. Give feedback to the GM(s), and the other players. It's amazing how fun that can be. Start discussing the campaign and characters infrequently, as time permits. Let the gm know what is good and bad about the game. While the gm has the final say, so to speak (this is not an absolute, of course), talk with her or him often, letting that person get an idea of how the campaign is going, both in atmosphere and rules, and if any changes need to be made.
For a new DM, don't over plan. I've had my best sessions when I didn't have any idea what was going to happen until my group started playing. For a new player, try to make a character based on who you are, but put in enough differences to separate you from 'him' or 'her'. And care about your character.
"Remember, it's only a game."