Aisha reported: The Messenger of Allah, peace and blessings be upon him, said:
No believer is pricked by a thorn or more but that Allah will raise him one degree in status or erase a sin.
Source: Ṣaḥīḥ al-Bukhārī 5317, Ṣaḥīḥ Muslim 2572
Grade: Mutaffaqun Alayhi (authenticity agreed upon) according to Al-Bukhari and Muslim
In another hadith Prophet (peace be upon him)said:
Wondrous is the affair of the believer for there is good for him in every matter and this is not the case with anyone except the believer. If he is happy, then he thanks Allah and thus there is good for him. If he is harmed, then he shows patience and thus there is good for him.
Source: Ṣaḥīḥ Muslim 2999, Grade: Sahih
Trials can be a sign that Allah intends good for us, because through trials our sins are expiated and we have the opportunity to perform good deeds.
Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:
If Allah intends good for someone, then he afflicts him with trials.
Source: Ṣaḥīḥ al-Bukhārī 5321, Grade: Sahih
know that Allah loves you and He wants good for you, keep doing the good things and keep your trust in Allah Subhanahu Wa Taala.