It is narrated from Hazrat Hudhaifa (may Allah be pleased with him) that when the Prophet Muhammad (peace and blessings be upon him) was faced with any distressing matter, he would perform prayer.
Hadith Referenceمسند احمد / مسند الأنصار رضي الله عنهم / 23299
Hadith Gradingحکم دارالسلام:إسناده ضعيف لجهالة محمد بن عبدالله، وعبدالعزيز