Sahih al-Bukhari 1252
Sahih al-Bukhari · Book 23: Funerals (Al-Janaa'iz) · The saying of a man to a woman at the grave, "Be patient"
Narrated Anas bin Malik:
حَدَّثَنَا آدَمُ ، حَدَّثَنَا شُعْبَةُ ، حَدَّثَنَا ثَابِتٌ ، عَنْ أَنَسِ بْنِ مَالِكٍ ـ رضى الله عنه ـ قَالَ مَرَّ النَّبِيُّ صلى الله عليه وسلم بِامْرَأَةٍ عِنْدَ قَبْرٍ وَهِيَ تَبْكِي فَقَالَ " اتَّقِي اللَّهَ وَاصْبِرِي " .
The Prophet (ﷺ) passed by a woman who was sitting and weeping beside a grave and said to her, "Fear Allah and be patient."