Salaam Alaykum wa rahmatullâh. Bismillâh. This is a question that I have thought about at times. I hope the answer will expand my knowledge - in shaa Allâh. We know of course that Allâh forgives all sins if one repents to Him. But I also read that Allâh afflicts His servants with trials so they may get cleansed for their sins. Why are trials needed for those who turn to Allâh in repentance? Since we know that those who turn to Him in repentance is granted forgiveness by that alone. So why need for trials?
All perfect praise be to Allah, The Lord of the Worlds. I testify that none is worthy of worship except Allah and that Muhammad is His Slave and Messenger.
There are many wisdoms behind the afflictions that Allah decrees upon people. One of them is that they are means to expiate one’s sins of which he has not repented. Another is that they raise him in status and earn him greater rewards. If a person has sincerely repented of all his sins, then the wisdom behind the affliction that strikes him is to raise him in status and elevate him to higher ranks in the Sight of Allah, The Exalted. Perhaps he has a certain rank decreed for him by Allah, yet he cannot attain it by virtue of his good deeds alone; therefore, Allah, The Almighty, decrees such affliction for him to grant him that rank and status. The Prophet said: "A person would have a (high) rank with Allah which he cannot obtain by his deeds, so Allah continues to afflict him with things he dislikes until he reaches it." [Abu Ya'la and Ibn Hibbaan; Al-Albaani: Hasan (sound)]
Allah Knows best.
You can search for fatwa through many choices