Those are the times when positive thinking can be the most beneficial. Ironically, they are also the times when your mood is so grim you probably don't WANT to be positive.
The ability to remain upbeat even during the toughest times just comes naturally to some people. Others have to constantly train themselves to look on the brighter side of life.
Being able to use positive thinking when it is needed is a perfect example of mind over matter. And also mind over body.
When you maintain a certain level of optimism in your life, you feel healthier and recover from the knocks and bruises of life more quickly.