Sure Al-Baqara

2:119

إِنَّآ أَرْسَلْنَٰكَ بِٱلْحَقِّ بَشِيرًۭا وَنَذِيرًۭا ۖ وَلَا تُسْـَٔلُ عَنْ أَصْحَٰبِ ٱلْجَحِيمِ

Gewiß, Wir haben dich mit der Wahrheit gesandt als Frohboten und als Warner. Und du wirst nicht nach den (Taten der) Insassen des Höllenbrandes gefragt werden.

Tafsir 2:119

The Prophet was sent with the religion of truth, in which there is no doubt: to bring the good news of Paradise to those who have faith, and to warn disbelievers about the fire of Hell. The Prophet only had to clearly deliver the message: Allah will not ask him about those people in the fire of Hell who did not believe in him.