On the authority of Anas Bin Maalik (radi Allahu ‘anhu) who said that the Prophet (ﷺ) said,
When Allah wants good for His servant He hastens their punishment (and punishes them) in this world; and when Allah intends evil for His slave He withholds punishment from reaching them in his world and pays them their full account (of punishment) on the Day of Judgment. [Saheeh At-Tirmathee 2396]
Al ‘Allaamah Ahmad An Najmee (rahimahullah) said, In this Hadeeth (we are) informed that a servant may be tested and touched by calamities repeatedly to the point that they may think that Allah is displeased with them. However, this is not (necessarily) the case. Rather, it may very well be that Allah loves them and wants to test them with various trials so that they could come on the Day of Judgment while having their sins (greatly) reduced.