What to say to someone who lost a baby?

I don’t know what to say to someone who has lost a baby! I don’t want to not say anything but I don’t want to say the wrong thing. Do you think offering to support a charity would help?