If Allah has taken something away from you, it’s not a sign that He is upset with you. And if Allah has given you something it is not necessarily a sign that He is pleased with you.
If you are trying your best, if you’re seeking forgiveness Allah says I will never punish you while you are seeking forgiveness. So one of the ways of diverting punishment is to seek the Forgiveness of Allah subhanahu wa’ta’ala in that case He says, He will not punish those who are seeking His forgiveness.
in verse number 44 of Surat Al-An’am, when He says those who forgot us completely, We opened all the doors of materialism for them.
Because giving does not necessarily depict the pleasure of Allah, The pleasure of Allah is in the worship of Allah when you are trying to develop a good relationship with Allah, he gives you the Comfort, He gives you the contentment.
When Allah has taken something away from you, It is not necessarily a sign of His anger nor is it His punishment, no. if your relationship with Him is good It was a good thing.