(And We have not sent you except as a giver of glad tidings and a warner to all mankind,) i.e., to all of creation among those who are accountable for their deeds. This is like the Ayah:
That Allah is One and that His power is absolute was the subject in previous verses. In the present verse, it is being said that the Holy Prophet ﷺ “ was sent as the Messenger of Allah to all peoples of the world who are there now or will come in the future.
The word: كَافَّةً (Kaaffah) in: كَافَّةً لِلنَاس Kaaffatal-lin-naas: for all peoples) is used in the sense of making something universal and inclusive of all without the exclusion of anyone from it. The grammatical arrangement of the text required saying: لِلنَاس (lin-naasi kaaffatan: for the people as a whole) because the word: (kaaffah: all) is grammatically a hal (adverb) relatable to the word نَاس (naas: people). But, in order to put a clear accent on the universality of the mission of the Last Rasul of Allah, the word: كَافَّةً (Kaaffah: all) was set to come earlier.
Every prophet did missionary work directly with his people (community). That alone was practicable. Similarly, the Prophet Muhammad also became the direct dispenser of good news (mubashshir) and a direct warner (munzir) for his own people ( 6:92 ). But, since the institution of prophethood ended with him, he is now, by order, mubashshir and munzir for all the nations in the world. Just as he discharged both these functions in relation to his first addressees (in his own times), so in the same way, his followers as deputies had to discharge these functions in relation to all other addressees in later periods. This will be treated as continuity of his prophetic mission. The missionary work done by him during his life-time is directly within the ambit of his prophetic functions, while the work done after his life in this world, will be indirectly so. The mission of a prophet is always to convey the message of God. Thereafter, the reward or punishment, according to the response of the people, is for God to decide—in this world as well as in the Hereafter.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.