I've been on both sides of this issue as well, having lost a full-term infant to anencephaly 20 years ago. There is nothing you can say or do that will ease this sort of loss, however, just giving the parents a hug, praying with them (if you and they are comfortable with this), and offering to assist them with the many little details that accompany a death, lets them know that they are cared for and that their infant was important, no matter how brief his or her life was. That's what they'll remember years from now, when the pain that once pierced the heart like a knife has become a dull ache deep inside and life has long resumed its normal rhythms.........they'll remember how you were there for them in their hour of need, and they'll think of you with affection and admiration. It's how I remember my OB nurse, Terri, in whose arms my own baby drew her last breath, and who was there 18 months later to celebrate with us the birth of a new daughter. I haven't seen her since then, but I'll never forget her......and that, IMO, is what nursing is all about.
Trust me, you'll do fine........you already have everything you need to be a good nurse, and to be what bereaved parents need in their time of sorrow.