This is a GREAT question to ask. It seems universal that newer nurses tend to take their work "home" with them when they leave the building. I remember asking THE very same question about a year into my nursing. At that time, I worked on a Heme-Onc floor. Needless to say, a lot of people didn't survive their cancer or didn't survive the treatments. It got to me.
So. . . there was this one nurse who was ALWAYS compassionate towards her patients, and had an air of positivity which I desperately sought. I knew that she had a background in Hospice work. So, I approached her one day and asked that very question that you present to this forum, "Who do you keep such a warm smile on your face? How do you keep such a positive and even hopeful attitude??"
Her answer was wonderfully simple and exceedingly profound. She said, "Ted. I give these patient's the BEST eight hours of my time that I could possibly give them. Then, when I go home, I go home and leave work behind."
It wasn't so much the precise words that she spoke, it was more her facial expression as she said them. She had a sincere look of "Peace" when she said, ". . . when I go home, I go home. . . " I wish I could share you that look to you so that you could receive the same benefit as I did back then. It took a while for me to fully appreciate her answer to me (body language and all), but it's one that I practice faithfully . . . well, as best as I can.
Balancing work life and home life seems to be an art. I love what I do as a nurse but I also cherish my home life. My wife and I work hard to make sure we have time for each other. I also have very important hobbies. I'm a firm believer that there is more to life than work. We are more than just nurses. We are spouses, we are parents, we are musicians, we are vacationers, we are "part-time employee for some other job". Attempt to tap into that concept.
In reading your post, I have no doubt that you will work hard to give your patient's the best 8 (or 12) hours of your time to them. I see this because you express concern about how well things went during a code and wonder how you can do things better. Hopefully such concern will never stop. But, believe it or not, there is more to life than those 8 (or 12) important and worthwhile hours that you spend at your health-care facility. I would wager to bet that you have other interests worthy of your time and attention. If not, work to find those interests. They're important! Enjoy your relationships with your significant other or your friends or your whoever is important to you. It's my opinion that without such balance in life, that path toward burn out is what lies ahead. It doesn't take much to see who's burnt out. I've been there myself and it ain't pretty.
That balance in life is important. Now that you know that it is truly o.k. to leave work at work, do it! Live that life outside of work. . . and, as I type all of this to you, I WISH I could give you that look which was given to me by a WONDERFUL nurse many years ago.