Sure Al-Kahf

18:55

وَمَا مَنَعَ ٱلنَّاسَ أَن يُؤْمِنُوٓا۟ إِذْ جَآءَهُمُ ٱلْهُدَىٰ وَيَسْتَغْفِرُوا۟ رَبَّهُمْ إِلَّآ أَن تَأْتِيَهُمْ سُنَّةُ ٱلْأَوَّلِينَ أَوْ يَأْتِيَهُمُ ٱلْعَذَابُ قُبُلًۭا

Und nichts anderes hielt die Menschen davon ab, zu glauben, als die Rechtleitung zu ihnen kam, und ihren Herrn um Vergebung zu bitten, außer (ihrer Forderung), daß an ihnen nach der Gesetzmäßigkeit der Früheren verfahren werde oder daß die Strafe vor ihren Augen über sie komme.

Tafsir 18:55

Nothing prevented the obstinate disbelievers from having faith in what Muhammad (peace be upon him) brought from his Lord. Lack of explanation did not prevent them from seeking Allah’s forgiveness for their sins, for many examples were given to them in the Qur’ān and clear proofs came to them. The only thing that prevented them was their stubborn request for the punishment of the previous communities to be imposed on them and for them to see the punishment that they were promised.