Indeed, We have sent you, [O Muḥammad], with the truth as a bringer of good tidings and a warner, and you will not be asked about the companions of Hellfire.
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.