Ibn Hajr said:
“If a person sees his companion in a state of distress, it is preferred (mustahabb) for him to address him with that which will lift the stress and delight him.”
[Fath al-Bārī 363/9]
He used the comforting words of Khadījah to the Prophet ﷺ as an example.