Chapter 21: Funerals (Kitab Al-Jana'iz)
Narrated Muhammad ibn Khalid as-Sulami: on his father' s authority said his grandfather reported: He was a Companion of the Messenger of Allah (ﷺ) said: I heard the Messenger of Allah (ﷺ) say: When Allah has previously decreed for a servant a rank which he has not attained by his action, He afflicts him in his body, or his property or his children. Abu Dawud said: Ibn Nufail added in his version: "He then enables him to endure that." The agreed version goes: "So that He may bring him to the rank previously decreed from him by Allah."
Sunan Abi Dawud 3090