We sometimes think that being grateful is what we do after our problems are solved, but how terribly shortsighted that is. How much of life do we miss by waiting to see the rainbow before thanking God that there is rain?
Being grateful in times of distress does not mean that we are pleased with our circumstances. It does mean that through the eyes of faith we look beyond our present-day challenges.
(Taken from the talk called "Grateful in any Circumstances" by Dieter F Uchtdurf)