Surah An-Nisaa

4:147

مَّا يَفْعَلُ ٱللَّهُ بِعَذَابِكُمْ إِن شَكَرْتُمْ وَءَامَنتُمْ ۚ وَكَانَ ٱللَّهُ شَاكِرًا عَلِيمًۭا

What would Allah do with your punishment if you are grateful and believe? And ever is Allah Appreciative and Knowing.

Tafsir 4:147

There is no need for Allah to punish you if you are thankful to Him and have faith in Him. He is the One Who is Kind and Merciful. He only punishes you for your sins. If you do good actions, are thankful to Him for His favours and have faith in Him both inside and outside, He will never punish you. Allah is Grateful to the person who admits His favours; and He knows the faith of His creation. He will reward every person for his actions.