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

˹Through a messenger, saying˺, "Do not worship except Allah. Indeed, I am to you from Him a warner and a bringer of good tidings,"  

˹Saying:˺ ‘Worship none but God. Truly I am to you a warner from Him, of chastisement, if you disbelieve, and a bearer of good tidings’, of reward, if you believe.
القرآن:١١:٢

أَلَّا تَعْبُدُوا إِلَّا اللَّهَ ۚ إِنَّنِي لَكُمْ مِنْهُ نَذِيرٌ وَبَشِيرٌ  

{أ} أي بأن {لا تعبدوا إلا الله إنني لكم منه نذير} بالعذاب إن كفرتم {وبشير} بالثواب إن آمنتم.

See similar narrations below:

Collected by Qurʾān
quran:51:50

So flee to Allah. Indeed, I am to you from Him a clear warner.  

So flee unto God, that is to say, away from His punishment toward His reward by being obedient to Him and not disobeying Him. Truly I am a clear warner to you from Him.
القرآن:٥١:٥٠

فَفِرُّوا إِلَى اللَّهِ ۖ إِنِّي لَكُمْ مِنْهُ نَذِيرٌ مُبِينٌ  

{ففروا إلى الله} أي إلى ثوابه من عقابه بأن تطيعوه ولا تعصوه {إني لكم منه نذير مبين} بيِّن الإنذار.