Paul tells us three things that are God's will for each of us: "Rejoice always, pray without ceasing, give thanks in all circumstances; for this is the will of God in Christ Jesus for you" (1 Thess. 5:16–18). We have there joy, gratitude, and constant prayer in every circumstance. They are always linked. Joy springs from gratitude and prayer.
The opposite is also true: pessimism and grumbling are linked to depression. It is perverse, then, that we so often disobey God in our outlook and attitudes. We choose to take a glass-half-empty outlook and complain about our lives, and the price we pay is our joy and peace. It just makes no sense. Rejoicing and giving thanks are how we say, "Not my will, God, but yours be done." Rejoicing and giving thanks is the essence of humility, and it is the way God connects our hearts to his good purposes in all things, big and small. That is God's will, and if we follow it, we will much more easily discern his will for the details of our lives.-HT: Lydia Brownback (emphasis mine)