This is an excellent question, that many don't think about.
I've done over a dozen long haul flights (10+ hours). Some were real long hauls that consisted of several of these flights with layovers lasting between 30 minutes and 8 hours for a total of 30 plus hours travel time.
There are several tricks to the trade.
First check see if there is any way you can upgrade. Check with friends and family to see if they might have some frequent flyer miles they would share. Look for the deals. Do everything you can to get moved to the front!
I've rode the 'back of the bus' my first two trips, NEVER AGAIN. Most people don't understand what a difference it makes, but trust me there is a big difference. I'm not just talking about the free drinks, better food, better service, larger seats, comfort kits, free on demand movies, priority boarding, extra luggage limits and the list goes on. I'm talking frame of mind.
Being herded like cattle, cramped into a seat two sizes to small, for more than 4 hours is rough on the brain as well as the body.
However if you can't move to the front, here are some good basic tips to survive the 'cattle car'.
Try to get a seat at the bulkhead or the emergency row. These have more leg room.
Window seats are nice, but remember everyone will have to get up to let you out. If you plan to sleep it's great, but if you are prone to need to make 'pit stops' you might want an isle seat.
Eat a nice meal before you leave, and take some snacks onboard with you. If you are lucky, the food might be good, however as a rule it's more like "Purna People Chow".
Don't worry about your looks, dress in comfortable clothing. Tight clothing, and heals are a real killer.
Take a little care package in your carry on. A little cheap pair of thin slippers, toothbrush, toothpaste, and a travel size bottles of body freshener and lotion will do wonders!!! If you are real nice, you can ask the flight attendant if he/she might be able to find you a 'comfort kit'. I've seen them many times come up front and grab a kit for two for an economy passengers.
No matter where you sit, DRINK LOTS OF WATER and move the body!!!! They will show you a short film on exercises you can do in your seat, do them.
As for the mental part, if you are lucky you might enjoy the movies. However be prepared, just in case they aren't to your liking. Bring something to read, an iPOD, or your laptop, anything you might enjoy.
Sleeping isn't easy, however try to take a nap. Not only will this pass time, but will help you make the time change jump.
Most of all, remember to pack your sense of humor.