I have become a dad not long ago, and occurrences with newborns are really heavy (my kid is doing good). There is no righteousness involved in the way health problems strike babies. No baby deserves to suffer and no baby deserves to die. But sometimes they do. Luckily it happens a lot less than it used to. if it would be an animal in wild nature, chances would have been a lot worse. the paradise hope does not comfort any parent. The practicalities make a resurrection of a baby quite impossible.
Your friend will get lots of attention up to the funeral. after that you can show to be a real friend. Any show of sympathy will do good, as long as it is authentic. Probably there will already be lots of stuff in the house that will make them remember the baby. Kids room, baby cloths,.. it will be hard for them to go through that.