The Bible tells us that we should give thanks, to God, for everything.
That doesn't mean that we only give thanks when something goes "our way" or for blessings we receive, or things we have, or when times are good. Yes, we should give thanks at those times, and often do, but those aren't the only things we are to be thankful for.
When we are having a bad day, when we get into a car accident, when we are sick, we should give thanks. When the bus is not running on time and we are late for work and the boss yells at us, give thanks. When a relationship breaks up, when we are expecting guests for supper and we burn the food to a crisp, give thanks. Lose your job? Give thanks. Get a bad mark on a test or report card? Give thanks.
Sure, it's easy to give thanks for the good and positive things happening in our lives. But it's more difficult when things are going bad - especially when faced with times of serious illness or death. We don't often see these bad situations as something to be thankful for, but it's during those difficult situations when we really need to turn to the Lord. These are times when we learn and grow. Those are times when we can thank God that He cares about us and what we are going through.
Often when things are going good for us, we don't tend to put our trust in the Lord. It seems that we (not all of us, though, as I know some people are pretty good about trusting God during the good and the bad times) more often turn to Him when times are tough, praying (and sometimes begging) for things to get better. But this is a great time to learn to trust Him, have faith that He is with you no matter the results of your situation, and believe that no matter what, He loves you and will not leave you during the dark times (or at any time for that matter). Be thankful that He is there for you to turn to.
I know it's not easy to be thankful during rough times - at least that's what I find for me. Those are times when I want to be in control of things, when I want things to run smoothly, when I want everything to be good. However, I am not in control. God is. And no matter what happens during the rough times, God will be beside me and I know that I am in a process of growing and stretching in my faith.
I, myself, need to remember and learn to give thanks to God for the bad times as well as the good. I tell you, I'm a work in progress and still learning, even though I've been a Christian for awhile now. It's an ongoing process and something I hope I keep doing for the rest of my life.