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

Indeed, those who disbelieve - it is all the same for them whether you warn them or do not warn them - they will not believe.  

As for the disbelievers, the likes of Abū Jahl, Abū Lahab and such; alike it is for them whether you have warned them or have not warned them, they do not believe, as God knows very well, so do not hope that they will believe (read a-andhartahum pronouncing both hamzas, or by not pronouncing the second, making it an alif instead, and inserting an alif between the one not pronounced and the other one, or leaving ˹this insertion˺; al-indhār ˹‘warning’˺ is to give knowledge of something, and simultaneously instil an element of fear).
القرآن:٢:٦

إِنَّ الَّذِينَ كَفَرُوا سَوَاءٌ عَلَيْهِمْ أَأَنْذَرْتَهُمْ أَمْ لَمْ تُنْذِرْهُمْ لَا يُؤْمِنُونَ  

{إن الذين كفروا} كأبي جهل وأبي لهب ونحوهما {سواء عليهم أأنذرتهم} بتحقيق الهمزتين وإبدال الثانية ألفاً وتسهيلها وإدخال ألف بين المسهلة والأخرى وتركه {أم لم تنذرهم لا يؤمنون} لعلم الله منهم ذلك فلا تطمع في إيمانهم، والإنذار إعلام مع تخويف.

See similar narrations below:

Collected by Qurʾān
quran:36:10

And it is all the same for them whether you warn them or do not warn them - they will not believe.  

And it is the same to them whether you warn them (read a-andhartuhum, pronouncing both hamzas; or by substituting an alif for the second one; or by not pronouncing the second one but inserting an alif between the one not pronounced and the other one, or without ˹the insertion˺) or do not warn them, they will not believe.
القرآن:٣٦:١٠

وَسَوَاءٌ عَلَيْهِمْ أَأَنْذَرْتَهُمْ أَمْ لَمْ تُنْذِرْهُمْ لَا يُؤْمِنُونَ  

{وسواء عليهم أأنذرتهم} بتحقيق الهمزتين وإبدال الثانية ألفا وتسهيلها وإدخال ألف بين المسهلة والأخرى وتركه {أم لم تنذرهم لا يؤمنون}.