Your mom probably taught you how to say 'Thank You' when you got a treat, or something that you liked. It's something else entirely to get the raw end of a deal and be encouraged to have an attitude of gratitude. And yet that's what the Bible encourages us to do - "Sing and make music in your heart to the Lord, always giving thanks to God the Father for everything, in the name of our Lord Jesus Christ." (Eph 5:19-20).
I Thessalonians 5:16-19 concurs, "Be joyful always; pray continually; give thanks in all circumstances, for this is God's will for you in Christ Jesus. Do not put out the Spirit's fire." (NIV). If I can paraphrase - like any good parent, God doesn't like whining. If you want something harder, look at Matthew 5:44 "Love your enemies. Pray for those who persecute you." I know it sounds hard, but it's not just feel-good nonsense.
I can think of at least three good reasons for this command to be thankful. First, it is always proper to be thankful to God for all the many blessings He has given us. Second, when we are in rough circumstances, we may not be able to control what happens to us, but we do have control over our response. Third, as Adele Calhoun puts it in her book "Spiritual Disciplines Handbook: Practices That Transform Us" - thankfulness is the antidote to a critical spirit. Simply telling someone to be quiet or stop whining isn't enough - we must go a step further. By finding something worth being thankful for in any circumstance, we do change our attitude. Going through a rough time right now? I don't mean to minimize it or sound trite, but seriously, spend some time responding to God in thanks. You'll be glad you did, and you'll be a stronger and more content person for it.