I'm really, really bad at this, I avoid it like the plague. It doesn't come naturally what to say in these circumstances because I just joke about everything.
I haven't spoken to my friend in ages, and I knew she was struggling with this boyfriend thing and uni was tough, but she just messaged me to say her father committed suicide, and how she blames herself and all she can thing about is how she could have done this and that differently, and she feels terrible for the last thing she said to him.
I know the normal thing might seem to say "I'm really sorry to hear that, don't blame yourself" but it sounds very weird, and I don't know what else to say.