Allah Almighty has commissioned prophets (PBUT) to pine paise to the
pious and serve as a warning to sinners. The mission of Allah’s prophets
has been to guide people and invite them to the worship of Allah Almighty alone
so that nobody would have any excuse for not following them.
The Quran says:
(Allah sent all) messengers in order to give praise (to the pious) and to warn (sinners), so that people might have no excuse before Allah after (the coming of) these messengers. Allah is indeed Almighty and Wise.
Qur’an 4:165