Umm, not exactly. Expressing empathy and offering comfort are not formulaic things. And using some standard lines could do the opposite: make the person feel unheard and maybe even uncomfortable.