"In Judaism, we offer thanks to the Almighty for each gift, even as we ask (or remonstrate) about what we lack.
We do not modulate our gratitude based on an accounting, on some evaluation of profit and loss, nor does giving thanks necessarily mean that we are satisfied.
The very first blessing we say in the morning, our very first act of the day, expresses thanks that we are alive...even if we are ill.
We make a blessing over the gift of sight…even if our vision is dim.
And we give thanks for having clothes to put on...even if they are threadbare.
These obligatory blessings guard us against taking our most basic gifts for granted.
It feels easier and more natural to give thanks when everything seems to be going well, when we have peace and security, health and bounty.
But when we are in a situation of war and fear, of sickness and poverty, when our inclination is to cry and curse, it is much more difficult — but it is still possible and necessary.
When he was poor and starving, the famous Reb Zushya is said to have thanked God for giving him such a good appetite!
It is no coincidence that Reb Zushya's profound capacity for gratitude was matched by a deep relationship with God."
From the essay "Thankful for Thanksgiving" by Rabbi Adin Steisnaltz