Giving thanks to God with all our hearts is not always easy for us to do. Sometimes the complaints and the burdens take the thanksgiving out of our hearts. When we try to be thankful for God's goodness rather than the goodness of everything we are facing in life it shifts our focus. That is the foundation to be able to keep worshipping God when we face hardship: making our gratitude to be focused primarily on the goodness of God.
Even in great times we must be careful. Sometimes we can be more grateful for the gifts of God more than the gift-giver. The gifts of God our wonderful. But God is more wonderful. The things God can give us are great. But a relationship with God and experiencing His love is greater. If all we had was Jesus that would be more than enough.
Don't let the circumstances of life, whether good or bad, keep you from the most important thing we should be grateful for: God Himself.