First take your ACLS, it'll give you the rundown of the different areas of responsibility (i.e. team leader, meds/access, defib, airway/bagging, compressions, recorder, runner).
Then, try to be involved in codes that occur, and focus on one area of responsibility. I think when starting out, acting as the recorder is great b/c you get a sense of the bigger picture. Airway usually gets handled by the RT/airway team once they get there. Ideally, once you understand and become proficient at the different roles, you'll be comfortable with code situations. Additionally, the strength of your other team members will play a role in how comfortable you feel. Be involved in codes with more experienced nurses and afterwards learn from them.
If it's your patient that codes, of course you'll be the one to start CPR, but as soon as people arrive and start to take over, let them. Step back and talk to the docs about what happened and start working on your differential diagnoses. Don't be that primary nurse that is unable to give a good description of what happened prior to the code b/c they are too busy pounding on the chest. It's a team effort, and your coworkers will help... your job will be to help figure out the cause as you will know the patient/hx best.