I remember what a senior told me an attending told them, as a way of reassuring me: codes aren't hard. I mean, the patient is already dead, so you can't really frak it up anymore than it already is. Joking aside, point was that's not the part where intervention makes the most difference. It's when a patient is decompensating that should make you nervous, and your response matters most, because the patient is still alive, they are circling the drain and haven't gone down it yet. It gets harder once they code.
Furthermore, in being taught codes, keep cool. As long as good compressions are going and they're getting bagged, you have the time to take a breath and consider the
Hs and Ts - Wikipedia.
Codes are algorithmic, doing them isn't hard, and finding the reason for the code isn't either.
In any case, when you're handling the "circle the drain" part, that's also pretty straightforward.
It's everything before that point that's "hard," but you have time, training, (and before board certification supervision) to deal with it.