From my understanding, Muslims (are supposed to) blame themselves for evil deeds and be thankful for good deeds, and humans have free will to do good or bad deeds.
If we have free will to do good deeds, why must we be grateful for them? How to reconcile having free will with being grateful to Allah for enabling us to repent and do good deeds?
Firstly, praise be to Allaah Who has enabled you to repent and has guided you after you were misguided, Who has lighted the way for you and has made faith dear to you and made it attractive to you. To Him be all praise at all times.
We congratulate you on having been enabled to repent. This is a blessing for which thanks must be given, for Allaah accepts the repentance of the one who repents. -Means of expiating sin (IslamQA)
The Muslim is always asking his Lord to help him to give thanks to Him, because were it not for Allah’s helping His slave, he would not be able to give thanks. -Thanking Allah for His Many Blessings (IslamQA)
And Satan will say when the matter has been concluded, "Indeed, Allah had promised you the promise of truth. And I promised you, but I betrayed you. But I had no authority over you except that I invited you, and you responded to me. So do not blame me; but blame yourselves. I cannot be called to your aid, nor can you be called to my aid. Indeed, I deny your association of me [with Allah ] before. Indeed, for the wrongdoers is a painful punishment." - Quran 14:22
Abu Mussab has a video explaining Qadr and Free Will: Do I Have a Choice? (Qadr / Pre-Ordainment) by Abu Mussab Wajdi Akkari - Youtube
However, despite watching that video, I don't understand why we should be grateful for doing good deeds.