All matters are in the Hands of Allah, the Mighty and Sublime. He the Exalted said regarding Himself:
“Doer of whatsoever He intends [or wills].” (Hood: 107)
He also says:
“Verily Allah does what he wills.” (Al-Hajj: 18).
Therefore all things are in the Hands of Allah.
Man is never free from mistakes, sins and deficiency in implementing obligations. If Allah wants good for His servant, He quickens his punishment in this world either through his wealth or family or life or one of his associates because difficulties atone for sins. So if the punishment is quickened and Allah expiates the sins of the servant therewith, it means he'll meet Allah not having any sin. His afflictions and adversities would have purified him. An individual may have difficulties during his last moments due to some sins still left-over on him so that he could leave this world pure from sins. This is great favour because the adversities of this life are less intense compared to the punishment of the hereafter.
But if Allah wants evil for the servant, he gives him respite. He will only gradually grab him; He will shower blessings on him and put hardship away from him to such an extent that he becomes haughty. He would be culpably gladsome for the favours of Allah on him. Then, he'll meet Allah while he is engulfed in his sins for which Allah will punish him in the hereafter – we ask Allah for wellbeing. You should therefore realize, that Allah wanted evil for him because Allah held back his punishment until he recompenses him with it on the Day of Ressurrection.
Then he mentioned in this hadeeth that: “The enormity of rewards is from the severity of the trial”: that is to say: the more severe the affliction, the more tremendous the reward. The easy trials have
(relatively) little rewards, but the serious trials have huge rewards. Allah the Mighty and Sublime is bounteous towards the people, so when He tries them with adversities He recompenses them with great rewards over it; but when the affliction is slight, the rewards come (relatively) small too.
“And when Allah loves a group of people, He afflicts them. So, whoever is pleased will have pleasure and whoever is displeased will receive displeasure.”
This is additional glad tidings for the believer; if he is befallen with an affliction he should not think Allah – free is He from all imperfections – dislikes him. In fact, that could be from the signs of Allah’s love for the servant; that he is tested with afflictions. Hence, if he is pleased, patient and hopeful of rewards from Allah, he will receive pleasure. But if he despises, then he gets desipise.
This entails exhortation that the individual must be patient in the face of hardship so that pleasure will be written down for him from Allah – the Mighty and Sublime.
Allah alone grants success.