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:2:129

Our Lord, and send among them a messenger from themselves who will recite to them Your verses and teach them the Book and wisdom and purify them. Indeed, You are the Exalted in Might, the Wise."  

Our Lord! And send among them, the people of this House, a messenger, one of them and God granted him this petition with ˹the sending of˺ Muhammad (s), who shall recite to them Your signs, the Qur’ān, and teach them the Book, the Qur’ān, and Wisdom, that is, what the former contains of judgments, and purify them, cleanse them of idolatry; You are the Mighty, the Victor, the Wise, in His creation.
القرآن:٢:١٢٩

رَبَّنَا وَابْعَثْ فِيهِمْ رَسُولًا مِنْهُمْ يَتْلُو عَلَيْهِمْ آيَاتِكَ وَيُعَلِّمُهُمُ الْكِتَابَ وَالْحِكْمَةَ وَيُزَكِّيهِمْ ۚ إِنَّكَ أَنْتَ الْعَزِيزُ الْحَكِيمُ  

{ربنا وابعث فيهم} أي أهل البيت {رسولا منهم} من أنفسهم وقد أجاب الله دعاءه بمحمد {يتلو عليهم آياتك} القرآن {ويعلمهم الكتاب} القرآن {والحكمة} أي ما فيه من الأحكام {ويزكيهم} يطهرهم من الشرك {إنك أنت العزيز} الغالب {الحكيم} في صنعه.

See similar narrations below:

Collected by Qurʾān
quran:62:2

It is He who has sent among the unlettered a Messenger from themselves reciting to them His verses and purifying them and teaching them the Book and wisdom - although they were before in clear error -  

It is He Who sent to the unlettered ˹folk˺, ˹among˺ the Arabs (ummī means ‘one who cannot write or read a book’), a messenger from among them, namely, Muhammad (s), to recite to them His signs, the Qur’ān, and to purify them, to cleanse them from idolatry, and to teach them the Book, the Qur’ān, and wisdom, ˹in˺ the rulings that it contains, though indeed (wa-in: in has been softened from the hardened form, with its subject having been omitted, that is to say, ˹understand it as˺ wa-innahum) before that, ˹before˺ his coming, they had been in manifest error.
القرآن:٦٢:٢

هُوَ الَّذِي بَعَثَ فِي الْأُمِّيِّينَ رَسُولًا مِنْهُمْ يَتْلُو عَلَيْهِمْ آيَاتِهِ وَيُزَكِّيهِمْ وَيُعَلِّمُهُمُ الْكِتَابَ وَالْحِكْمَةَ وَإِنْ كَانُوا مِنْ قَبْلُ لَفِي ضَلَالٍ مُبِينٍ  

{هو الذي بعث في الأميين} العرب، والأمي: من لا يكتب ولا يقرأ كتابا {رسولا منهم} هو محمد ﷺ {يتلو عليهم آياته} القرآن {ويزكيهم} يطهرهم من الشرك {ويعلمهم الكتاب} القرآن {والحكمة} ما فيه من الأحكام {وإن} مخففة من الثقيلة واسمها محذوف، أي وإنهم {كانوا من قبل} قبل مجيئه {لفي ضلال مبين} بيّن.