As other have noted, you have to have something in your life, which is meaningful to you, outside of the hospital. It can be going to the gym, spending time with your SO, or ETOH (j/k).
Going to and from the hospital under cover of darkness, eating pre-prepared foods and doing that day after day, month after month, can get incredibly depressing. You need an outlet...you have to discover what is important in your life and make sure that you get at least one thing done.
If you do make a mistake, you need to step back and try to evaluate it clearly. Let me rephrase that....WHEN you make a mistake. And you will, especially when you are tired. The system has checks and balances and most of the time your mistakes will be caught before they cause anyone harm...they will become valuable learning experience for you.
IMHO, people have varying abilities to tolerate the long hours and ways to do so. I found that if I could not get some "real sleep" - ie, more than 90 minutes, I generally tolerated it better if I just stayed awake. I deal with being physically active much better than if I were sitting somewhere...(ie, Rads call would not be for me), but I have never required a lot of sleep. Some colleagues got used to the hours, others seemed to look and act like they'd been on a mission to Iraq after a single night on call.
As you progress in your residency, you will learn 'tricks" to making life better - certainly being more organized gets you home earlier and generates fewer pages at night, and the comment above about vacation is an absolute. I had fellow residents who refused to take vacation because they thought the service was "too busy" or they were simply afraid, IMHO, of telling the attendings they would be off. These residents were much more miserable than the average and burned out earlier.