The meaning of the verse
This verse is phrased as a restriction: the only purpose of sending the Prophet ﷺ is mercy. "Al-'alamin" (the worlds) includes all humans and jinn, because his message is for all of them. The guidance, Shariah and character that the Prophet ﷺ brought are the real mercy, freeing hearts from shirk (associating partners with Allah) and ignorance, and freeing society from injustice. Surah Al-Anbiya is a Makki surah, and this verse comes after the stories of earlier prophets, as though the continuous call of all the prophets reached the Prophet ﷺ as the completion of mercy.
How is the Prophet ﷺ a mercy for everyone?
The scholars of tafsir write that for whoever follows the Prophet ﷺ, he is a mercy in both this world and the Hereafter. And whoever does not believe also benefits from this mercy, in that a punishment destroying the whole nation at once, like that of earlier peoples, did not come upon him. His mercy can be seen everywhere in his life: a dua for guidance instead of a curse for those who harmed him severely, a general pardon on the day of the conquest of Makkah, and the command to be gentle with the weak, orphans, women and even animals.
In Sahih Muslim, when the Prophet ﷺ was asked to invoke a curse on the polytheists, he said that he was not sent to curse, but was sent as a mercy. And in Sunan Abi Dawud, this dua of his is reported: if I have abused or cursed any person of my ummah in anger, O Allah, make it a mercy for him on the Day of Resurrection, because I was sent as a mercy for the worlds.
Key lessons
True belief in the Mercy to the Worlds means following the Shariah he brought, because that is the real door to mercy. His life requires that Muslims too become a means of gentleness, forgiveness and goodwill for others, and avoid cursing and taunting. One should also avoid exaggeration about this title; for example, the famous saying "if it were not for you, the heavens and the earth would not have been created" is not established by any authentic hadith. The Quran and authentic hadith are enough to show the greatness of the Prophet ﷺ.