(((Hugs))) Losing a patient is hard, especially your first one, and especially as a student. I'm sorry you had to actually perform CPR the first time you ever saw a code. It's easier if you get to observe for a time before being expected to help out. It's OK to cry about the experience, we understand. We have all been there at some point or another. We have all had that first patient death, that young patient that died, and that patient that just tugged at our heart strings when they left.
It does get easier to handle, to some extent. It changes with time, and you are able to set your emotions aside for the time being and do your job. But, every single patient still tugs at your heart, reminding you of that common link of humanity we all share. I think with every patient I have, I get this little "that could be me, or my family" moment that inspires me to give the best care I can give. My EMT professor used to tell us that if it ever got to the point where it didn't hurt anymore, it was time to change professions. The crying you did with the wife today was helpful to her, as well as you. You showed her that you cared, that her pain mattered to her. This goes a long way toward helping another.
Take some time for you in this. Take some time to cry, relax, do something to release your stress, whatever helps you right now. Take some time to work through those emotions, they are hard to deal with (especially the first time). Don't ever bottle those emotions up and not deal with them. Trust me, from someone who did that, it is not a pretty situation and leads to burnout.
Use this as a learning situation in your professional growth; learn about death and dying and your feelings related to it. As sheltered from death as our culture tends to be, it is a normal part of life. As nurses, we will see death and dying every day, and we will need to be able to accept that fact.
(((Hugs))) again, it's not easy to watch your first patient die, especially not at a younger age and in that way. If you need to talk, we're here to listen!