You'll get through 你会挺过去的pull yourself together 振作一点hang in there, things'll get better 坚持住,会好起来的
先用固定句式I'm sorry to hear that.对他的不幸遭遇表示同情理解,然后可以说Misfortune may be an actual blessing.(塞翁失马焉知非福)来安慰他。
如果是有朋友的亲属去世,可以用I'm sorry for you lost.