It was the practice of the Prophet (peace and blessings be upon him):
"When a matter troubled him (peace and blessings be upon him), he (peace and blessings be upon him) would pray."
Hadith Referenceصحیح الجامع الصغیر / حرف الكاف / 4703
Hadith Gradingالألبانی:حسن
Hadith Takhrij[حم د] عن حذيفة. المشكاة ١٣٢٥، صحيح أبي داود ١١٩٢.