Patience is half of faith and thankfulness is the other half.
Patience is required in all states – good and bad. In regards to good states, patience means not relying on the blessings you have been given and understanding that they could be taken away at any point. It means staying within the limits of sharia and not being excessive.
As for things that are against your desire, they can be split into three categories
• Of your choosing – acts of worship and staying away from sins
• Not of your choosing – trials and calamity
• Not originally of your choosing – responding to the annoyance of people
1) Worship and Sins
Being patient with acts of worship is to complete them fully, with the correct intention and sincerity and with the presence of your heart.
Being patient with sins is to avoid them, however big or small, and turning to Allah in repentance.
2) Patience with fate
Not uttering a word of complaint when a calamity befalls you or mentioning your affliction. Instead saying Alhamdulillah (All Praise to Allah) and bearing it. This does not mean to abandon means of removing said calamity i.e. taking the appropriate medicine when you are ill, but do not complain to about your Lord to His creation.
3) Patience with how you respond to others
Patience is split in two – patience with anger and patience with desire. Revenge to the exact degree to which you were done wrong is permissible however to forgive is better. Deal with creation as you would like Allah to deal with you.
Thankfulness is also necessary in times of hardship as well as ease. In times of hardship try to remember that however bad your situation might be, it could have been worse. Think about those people who have no food, clothes, shelter or freedom. Whatever your situation, there will always be people who would choose your affliction over theirs. Bear this in mind, and always give thanks to Allah.
Thankfulness (or gratitude) has three pillars; knowledge, state and action.
Knowledge of the blessing, the One who gives the blessing and that all blessings are from Allah are the first aspects of thankfulness.
2) The state that results from the blessing
Perfect gratitude is joy that the blessing may be used as a means to Allah, for through His blessings, righteous deeds are completed. A lesser gratitude is joy over the Giver of the blessings in the sense that you see the blessing as a sign of Allah’s care for you and you derive joy from that.
To use the blessing in a way which is beloved to Allah and not against His command. For example – to use the eye to read Quran, look at parents/a spouse with love, covering the faults of other Muslims, etc is thankfulness for the eye. To use it for looking at impermissible things however, is to be ungrateful for the eye, sun and whatever else has facilitated that look.