Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:93:7

And He found you lost and guided ˹you˺,  

And did He not find you erring, from the ˹revealed˺ Law which you ˹now˺ follow, and guided you?, that is, and then guided you to it.
القرآن:٩٣:٧

وَوَجَدَكَ ضَالًّا فَهَدَىٰ  

{ووجدك ضالا} عما أنت عليه من الشريعة {فهدى} أي هداك إليها.

See similar narrations below:

Collected by Ḥākim, Ṭabarānī, Suyūṭī
hakim:3944Abū al-Faḍl Muḥammad b. Ibrāhīm al-Muzakkī Imlāʾ > Aḥmad b. Salamah > ʿAbdullāh b. al-Jarrāḥ > Ḥammād b. Zayd > ʿAṭāʾ b. al-Sāʾib > Saʿīd b. Jubayr > Ibn ʿAbbās

that the Prophet ﷺ said, "I asked Allah a question that I would have liked that I had not asked Him. I mentioned the Prophets of my Lord and I said: O my Lord, You subdued the wind for Sulaymān (Solmon), and You spoke to Mūsá (Moses). Then Allah ﷻ said, 'Did I not find you an orphan and I gave you refuge? And lost and I guided you? And poor and made you self-sufficient?'" He said: "I said: Yes. I would have liked that I had not asked."  

الحاكم:٣٩٤٤حَدَّثَنَا أَبُو الْفَضْلِ مُحَمَّدُ بْنُ إِبْرَاهِيمَ الْمُزَكِّي إِمْلَاءً ثنا أَحْمَدُ بْنُ سَلَمَةَ ثنا عَبْدُ اللَّهِ بْنُ الْجَرَّاحِ ثنا حَمَّادُ بْنُ زَيْدٍ عَنْ عَطَاءِ بْنِ السَّائِبِ عَنْ سَعِيدِ بْنِ جُبَيْرٍ عَنِ ابْنِ عَبَّاسٍ

أَنَّ النَّبِيَّ ﷺ قَالَ سَأَلْتُ اللَّهَ مَسْأَلَةً وَدِدْتُ أَنِّي لَمْ أَكُنْ سَأَلْتُهُ ذَكَرْتُ رُسُلَ رَبِّي فَقُلْتُ يَا رَبِّ سَخَّرْتَ لِسُلَيْمَانَ الرِّيحَ وَكَلَّمْتَ مُوسَى فَقَالَ تَبَارَكَ وَتَعَالَى أَلَمْ أَجِدْكَ يَتِيمًا فَآوَيْتُكَ وَضَالًّا فَهَدَيْتُكَ وَعَائِلًا فَأَغْنَيْتُكَ؟ قَالَ فَقُلْتُ نَعَمْ فَوَدِدْتُ أَنْ لَمْ أَسْأَلْهُ  

«هَذَا حَدِيثٌ صَحِيحُ الْإِسْنَادِ وَلَمْ يُخَرِّجَاهُ» صحيح
tabarani:12289ʿAlī b. ʿAbd al-ʿAzīz > ʿĀrim Abū al-Nuʿmān > Ḥammād b. Zayd > ʿAṭāʾ b. al-Sāʾib > Ḥammād b. Zayd Aẓunnuh > Saʿīd b. Jubayr > Ibn ʿAbbās > Rasūl

the Messenger of Allah ﷺ said, "I asked my Lord a question that I would have liked that I had not asked Him. I said, O my Lord, there were Prophets before me: Prophets among them for whom You had subdued the winds, and among them who would raise the dead. He said: 'Did I not find you an orphan and I gave you refuge? And lost and I guided you? And poor and made you self-sufficient? Did I not expand your breast and removed from you your burden?'" He said, "I said: Of course, my Lord."  

Both their statements were the same.
الطبراني:١٢٢٨٩حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ الْعَزِيزِ ثنا عَارِمٌ أَبُو النُّعْمَانِ ثنا حَمَّادُ بْنُ زَيْدٍ عَنْ عَطَاءِ بْنِ السَّائِبِ قَالَ حَمَّادُ بْنُ زَيْدٍ أَظُنُّهُ عَنْ سَعِيدِ بْنِ جُبَيْرٍ عَنِ ابْنِ عَبَّاسٍ قَالَ

قَالَ رَسُولُ اللهِ ﷺ ح وَحَدَّثَنَا الْحُسَيْنُ بْنُ إِسْحَاقَ التُّسْتَرِيُّ ثنا أَبُو الرَّبِيعِ الزَّهْرَانِيُّ ثنا حَمَّادُ بْنُ زَيْدٍ عَنْ عَطَاءِ بْنِ السَّائِبِ عَنْ سَعِيدِ بْنِ جُبَيْرٍ عَنِ ابْنِ عَبَّاسٍ ؓ قَالَ قَالَ رَسُولُ اللهِ ﷺ سَأَلْتُ رَبِّي مَسْأَلَةً وَدِدْتُ أَنِّي لَمْ أَسْأَلْهُ قُلْتُ يَا رَبِّ كَانَتْ قَبْلِي رُسُلٌ مِنْهُمْ مَنْ سَخَّرْتَ لَهُمُ الرِّيَاحَ وَمِنْهُمْ مَنْ كَانَ يُحْيِي الْمَوْتَى قَالَ أَلَمْ أَجِدْكَ يَتِيمًا فآوَيْتُكَ؟ أَلَمْ أَجِدْكَ ضَالًّا فَهَدَيْتُكَ؟ أَلَمْ أَجِدْكَ عَائِلًا فَأَغْنَيْتُكَ؟ أَلَمْ أَشْرَحْ لَكَ صَدْرَكَ وَوَضَعْتُ عَنْكَ وِزْرَكَ؟ قَالَ قُلْتُ بَلَى يَا رَبِّ ولَفْظُهُما وَاحِدٌ  

ولَفْظُهُما وَاحِدٌ
suyuti:14630a

"I asked my Lord a question that I would have liked that I had not asked it of Him. I said: O my Lord, there were Prophets before me: Among them ˹were those˺ who would raise the dead, and among them ˹were those˺ for whom You had subdued the winds. Then He said: 'Did I not find you an orphan and I gave you refuge?' I said: Of course, my Lord. He said, 'Did I not find you lost and I guided you?' I said: Of course, my Lord. He said, 'Did I not find you poor and made you self-sufficient?' I said: Of course, my Lord. He said, 'Did I not expand your breast and removed from you your burden? Did I not elevate your mention?' I said: Of course, my Lord. I would have liked that I had not asked."  

السيوطي:١٤٦٣٠a

"سَأَلْتُ رَبَّى مَسْأَلَةً وَوَددْتُ (أَنِّى لَمْ أَكُنْ سأَلْتُهُ إِيَّاهَا؛ قُلْتُ: يا رب، إِنَّهُ قَدْ كَانَ قَبْلِى رُسُلٌ، مِنْهُمْ مَنْ كَانَ يُحْيى الْمَوْتَى، وَمِنْهُمْ مَنْ سَخَّرْتَ لَهُ الرِّيحَ، فَقَالَ: أَلَمْ أَجِدْكَ يتيما فأويتك؟ قلت بلى يا رب. قال: ألم أجدك ضَالًا فَهَدَيْتُكَ؟ قُلتُ بَلَى يَا رَبِّ. قَالَ أَلَمْ أَجِدْكَ عَائِلًا فأَغْنَيْتُكَ؟ قلت بلى يا رب، قَالَ: أَلم أَشرح لك صَدْرَكَ؟ أَلم أَضَعْ عَنْكَ وزْرَكَ الذى أَنقض ظهرك؟ أَلم أَرفع لك ذكرك؟ قلت: بلى يَا رَبِّ. فوددت أَنى لم أَسأَله".

ق في كر عن ابن عباس.  

[ك] الحاكم في المستدرك [كر] ابن عساكر في تاريخه عن ابن عباس