One of the tasks of all prophets (a) in general and of the Noble Prophet of Islam (s) in particular was to purify people. Regarding this, Surah 62, ayah 2 reads,
هُوَ الَّذِي بَعَثَ فِي الْأُمِّيِّينَ رَسُولًا مِنْهُمْ يَتْلُو عَلَيْهِمْ آيَاتِهِ وَيُزَكِّيهِمْ وَيُعَلِّمُهُمُ الْكِتَابَ وَالْحِكْمَةَ وَإِنْ كَانُوا مِنْ قَبْلُ لَفِي ضَلَالٍ مُبِينٍ
It is He who sent to the unlettered [people] an apostle from among themselves, to recite to them His signs, to purify them, and to teach them the Book and wisdom, and earlier they had indeed been in manifest error.
This fact has also been referred to in three other ayat of the Glorious Qur’an. Among these tasks, purification holds an important position and indeed it is the summation of the whole mission of the Noble Prophet (s). He has the ability to purify other people because he is already purified, as Surah 33, ayah 33 explains,