Abu Hurairah (RAA) narrated that the Messenger of Allah (ﷺ) said:
"Avert the infliction of the prescribed punishment as long as you find a way out (i.e. to avoid their infliction). Related by Ibn Majah with a weak chain of narrators. (JA)
English reference (JA): Book 10, Hadith 1258 (JA)
Arabic reference (JA): Book 10, Hadith 1219 (JA)