Sure Al-Mumtahana

60:6

لَقَدْ كَانَ لَكُمْ فِيهِمْ أُسْوَةٌ حَسَنَةٌۭ لِّمَن كَانَ يَرْجُوا۟ ٱللَّهَ وَٱلْيَوْمَ ٱلْءَاخِرَ ۚ وَمَن يَتَوَلَّ فَإِنَّ ٱللَّهَ هُوَ ٱلْغَنِىُّ ٱلْحَمِيدُ

Ihr habt ja in ihnen ein schönes Vorbild, und zwar für einen (jeden), der auf Allah und (auf) den Jüngsten Tag hofft. Wer sich jedoch abkehrt, so ist Allah der Unbedürftige und Lobenswürdige.

Tafsir 60:6

This good example is only followed by those who have hope for good from Allah in the world and afterlife. Those who turn away from this good example, then Allah is in no need of His servants. He does not require their obedience and He is worthy of praise in every state.