Sure An-Nisaa

4:80

مَّن يُطِعِ ٱلرَّسُولَ فَقَدْ أَطَاعَ ٱللَّهَ ۖ وَمَن تَوَلَّىٰ فَمَآ أَرْسَلْنَٰكَ عَلَيْهِمْ حَفِيظًۭا

Wer dem Gesandten gehorcht, der gehorcht Allah, und wer sich abkehrt, - so haben Wir dich nicht als Hüter über sie entsandt.

Tafsir 4:80

Whoever follows the Messenger by fulfilling his instructions and avoiding his prohibitions has actually followed Allah. If anyone turns away from following you, O Messenger, do not feel sad about it, because I have not sent you as a guard to watch over what they do. I am the One Who will watch them and hold them to account for their actions.