Al-A'raaf • BN-TAFSEER-IBN-E-KASEER
﴿ وَإِذْ قَالَتْ أُمَّةٌۭ مِّنْهُمْ لِمَ تَعِظُونَ قَوْمًا ۙ ٱللَّهُ مُهْلِكُهُمْ أَوْ مُعَذِّبُهُمْ عَذَابًۭا شَدِيدًۭا ۖ قَالُوا۟ مَعْذِرَةً إِلَىٰ رَبِّكُمْ وَلَعَلَّهُمْ يَتَّقُونَ ﴾
“And whenever some people among them asked [those who tried to restrain the Sabbath-breakers], "Why do you preach to people whom God is about to destroy or [at least] to chastise with suffering severe?" -the pious ones would answer, "In order to be free from blame before your Sustainer, and that these [transgressors, too,] might become conscious of Him."”
Please check ayah 7:166 for complete tafsir.