One of the earliest lessons learnt about the downfall of Iblis [Devil] was his lack of gratitude to Allah, when he became jealous of Adam AS’s creation and refused to prostrate to him even though Allah commanded him to. It started with the lack of gratitude by Iblis, which escalated into jealousy, arrogance and finally disobedience. It is the fundamental lack of gratitude that was the root cause of Iblis’s banishment from Paradise, and for him to eternally be cursed.
Gratitude to Allah is a fundamental component of a Muslim’s attitude and psychology. It is often balanced with patience, so that the overall picture is for a Muslim to be grateful for Allah’s bounties and patient for Allah’s reward if Allah gives something undesirable. Hence a Muslim should be either both patient and grateful in various degrees.