St. Gregory the Great:
For it is written: On the day of prosperity do not forget affliction, and on the day of affliction do not forget prosperity. For if a man receives God's gifts, but forgets his affliction, he can fall through his own excessive joy. On the other hand, when a man is bruised by the scourges, but is not at all consoled by the thought of the blessings he has been fortunate to receive, he is completely cast down.
Thus both attitudes must be united so that one may be supported by the other: the memory of the gift can temper the pain of the affliction, and the foreboding and fear of the affliction can modify the joy of the gift.