So this thread has a lot of good things you SHOULD do, how about I list a couple things you SHOULDN'T.
1.If you are large like myself (6'4, very fat) and you would like to be in the pit during MUSE, don't try to bare through the entire opening act. Me and my friend attempted this. After 30 seconds to mars we were fine, AFI took a lot out of us, and by the time MUSE took the stage, I had to go back to our seats. It was kind of disappointing at first, but I ended up rocking out with a couple awesome DJ's and other radio winners. If you must be in the pit, well it all really depends on the type of gig. Festivals will take a lot out of you, but if there is one opening band, chances are the pit wont be so bad.
2.Don't eat the $12 nacho and pepsi special before going into the pit. This makes everything worse for you. To put it bluntly, it will fuck your shit up big time. You will feel like throwing up the entire time. It's not fun. This does not mean do not eat though. By all means you should get a good meal in you before the show (not too close to the show though. Eat a nice meal an hour or two before the show, also try to snatch up a water bottle and a couple cliff bars for in the pit. It will make everything so much better.)
3.Don't wear ripped pants in the pit. People will rip your pants to shreds with their feet, and you will likely trip and cause people to fall over. Make sure your pants are in good moshing condition (not ripped, proper length, etc). We don't want you tripping all over yourself.
4.Don't smoke cigarettes in the mosh pit. The smoke lingers and most people hate the smell and WILL get very pissed. If you can't wait two hours for a cigarette you are a jerk. If you absolutely HAVE to smoke that cig, do it before or after the show. Many people will be smoking cannabis at the show (if it's the US at least). The use of cannabis at concerts is widespread. It is also illegal. The people smoking the weed do not want to risk being caught by security so they will try to do it as discreetly as possible. Now if you see this and are offended by it, make it known to them (grunt and stare at them) and they will be on their merry way. If they are assholes who are practically blowing the smoke in your face, tell security. Punk ass bitches need to learn some respect one way or another. (this last one may be a little controversial. It's true though. LOADS of people will be smoking the cannabis in the pit. It's a held in a different light then cigarettes here in the US. Second hand tobacco smoke causes cancer and smells like ass, Second hand cannabis smoke just smells like a variation of a skunk.)
Everything else has basically been covered before in this thread.