The Prophet ﷺ said, "While three men were walking, It started raining and they took shelter (refuge) in a cave in a mountain. A big rock rolled down from the mountain and closed the mouth of the cave. They said to each other, "Think of good deeds which you did for Allah's sake only, and invoke Allah by giving reference to those deeds so that He may remove this rock from you." One of them said, 'O Allah! I had old parents and small children and I used to graze the sheep for them. On my return to them in the evening, I used to milk (the sheep) and start providing my parents first of all before my children. One day I was delayed and came late at night and found my parents sleeping. I milked (the sheep) as usual and stood by their heads. I hated to wake them up and disliked to give milk to my children before them, although my children were weeping (because of hunger) at my feet till the day dawned. O Allah! If I did this for Your sake only, kindly remove the rock so that we could see the sky through it.' So, Allah removed the rock a little and they saw the sky. The second man said, 'O Allah! I was in love with a cousin of mine like the deepest love a man may have for a woman. I wanted to outrage her chastity but she refused unless I gave her one hundred Dinars. So, I struggled to collect that amount. And when I sat between her legs, she said, 'O Allah's slave! Be afraid of Allah and do not deflower me except rightfully (by marriage).' So, I got up. O Allah! If I did it for Your sake only, please remove the rock.' The rock shifted a little more. Then the third man said, 'O Allah! I employed a laborer for a Faraq of rice and when he finished his job and demanded his right, I presented it to him, but he refused to take it. So, I sowed the rice many time till I gathered cows and their shepherd (from the yield). (Then after some time) He came and said to me, 'Fear Allah (and give me my right)." I said, 'Go and take those cows and the shepherd.' He said, 'Be afraid of Allah! Don't mock at me.' I said, 'I am not mocking at you. Take (all that).' So, he took all that. O Allah! If I did that for Your sake only, please remove the rest of the rock.' So, Allah removed the rock."
عَنِ النَّبِيِّ ﷺ قَالَ بَيْنَمَا ثَلاَثَةُ نَفَرٍ يَمْشُونَ أَخَذَهُمُ الْمَطَرُ فَأَوَوْا إِلَى غَارٍ فِي جَبَلٍ فَانْحَطَّتْ عَلَى فَمِ غَارِهِمْ صَخْرَةٌ مِنَ الْجَبَلِ فَانْطَبَقَتْ عَلَيْهِمْ فَقَالَ بَعْضُهُمْ لِبَعْضٍ انْظُرُوا أَعْمَالاً عَمِلْتُمُوهَا صَالِحَةً لِلَّهِ فَادْعُوا اللَّهَ بِهَا لَعَلَّهُ يُفَرِّجُهَا عَنْكُمْ قَالَ أَحَدُهُمُ اللَّهُمَّ إِنَّهُ كَانَ لِي وَالِدَانِ شَيْخَانِ كَبِيرَانِ وَلِي صِبْيَةٌ صِغَارٌ كُنْتُ أَرْعَى عَلَيْهِمْ فَإِذَا رُحْتُ عَلَيْهِمْ حَلَبْتُ فَبَدَأْتُ بِوَالِدَىَّ أَسْقِيهِمَا قَبْلَ بَنِيَّ وَإِنِّي اسْتَأْخَرْتُ ذَاتَ يَوْمٍ فَلَمْ آتِ حَتَّى أَمْسَيْتُ فَوَجَدْتُهُمَا نَامَا فَحَلَبْتُ كَمَا كُنْتُ أَحْلُبُ فَقُمْتُ عِنْدَ رُءُوسِهِمَا أَكْرَهُ أَنْ أُوقِظَهُمَا وَأَكْرَهُ أَنْ أَسْقِيَ الصِّبْيَةَ وَالصِّبْيَةُ يَتَضَاغَوْنَ عِنْدَ قَدَمَىَّ حَتَّى طَلَعَ الْفَجْرُ فَإِنْ كُنْتَ تَعْلَمُ أَنِّي فَعَلْتُهُ ابْتِغَاءَ وَجْهِكَ فَافْرُجْ لَنَا فَرْجَةً نَرَى مِنْهَا السَّمَاءَ فَفَرَجَ اللَّهُ فَرَأَوُا السَّمَاءَ وَقَالَ الآخَرُ اللَّهُمَّ إِنَّهَا كَانَتْ لِي بِنْتُ عَمٍّ أَحْبَبْتُهَا كَأَشَدِّ مَا يُحِبُّ الرِّجَالُ النِّسَاءَ فَطَلَبْتُ مِنْهَا فَأَبَتْ حَتَّى أَتَيْتُهَا بِمِائَةِ دِينَارٍ فَبَغَيْتُ حَتَّى جَمَعْتُهَا فَلَمَّا وَقَعْتُ بَيْنَ رِجْلَيْهَا قَالَتْ يَا عَبْدَ اللَّهِ اتَّقِ اللَّهَ وَلاَ تَفْتَحِ الْخَاتَمَ إِلاَّ بِحَقِّهِ فَقُمْتُ فَإِنْ كُنْتَ تَعْلَمُ أَنِّي فَعَلْتُهُ ابْتِغَاءَ وَجْهِكَ فَافْرُجْ عَنَّا فَرْجَةً فَفَرَجَ وَقَالَ الثَّالِثُ اللَّهُمَّ إِنِّي اسْتَأْجَرْتُ أَجِيرًا بِفَرَقِ أَرُزٍّ فَلَمَّا قَضَى عَمَلَهُ قَالَ أَعْطِنِي حَقِّي فَعَرَضْتُ عَلَيْهِ فَرَغِبَ عَنْهُ فَلَمْ أَزَلْ أَزْرَعُهُ حَتَّى جَمَعْتُ مِنْهُ بَقَرًا وَرَاعِيهَا فَجَاءَنِي فَقَالَ اتَّقِ اللَّهَ فَقُلْتُ اذْهَبْ إِلَى ذَلِكَ الْبَقَرِ وَرُعَاتِهَا فَخُذْ فَقَالَ اتَّقِ اللَّهَ وَلاَ تَسْتَهْزِئْ بِي فَقُلْتُ إِنِّي لاَ أَسْتَهْزِئُ بِكَ فَخُذْ فَأَخَذَهُ فَإِنْ كُنْتَ تَعْلَمُ أَنِّي فَعَلْتُ ذَلِكَ ابْتِغَاءَ وَجْهِكَ فَافْرُجْ مَا بَقِيَ فَفَرَجَ اللَّهُ قَالَ أَبُو عَبْدِ اللَّهِ وَقَالَ ابْنُ عُقْبَةَ عَنْ نَافِعٍ فَسَعَيْتُ