4 “To tell of Your mercy early in the morning, and of Your truth in the night season”. What is the meaning of this; that the mercy of God is to be told us in the morning, and in the night the truth of God? The morning is, when it is well with us; the night, the sadness of tribulation. What then did he say in brief? When you are prosperous, rejoice in God, for it is His mercy. Now, perhaps you would say, If I rejoice in God, when I am prosperous, because it is His mercy; what am I to do when I am in sorrow, in tribulation?
It is His mercy, when I am prosperous; is it then His cruelty, when I am in adversity? If I praise His mercy when it is well with me, am I then to exclaim against His cruelty when it is ill? No. But when it is well, praise His mercy: when ill, praise His truth: because He scourges sins, He is not unjust....During the night Daniel confessed the truth of God: he said in his prayer, “We have sinned, and committed iniquity, and have done wickedly. O Lord, righteousness belongs unto You: but unto us confusion of face.” He told of the truth of God during the night-season.
What is it to tell of the truth of God in the night-season? Not to accuse God, because you suffer anything of evil: but to attribute it to your sins, His correction: to tell of His loving-kindness early in the morning, and of His truth in the night-season. When you do this, you always praise God, always confess to God, and sing unto His Name.
Source: The Enarrations, or Expositions, on the Psalms (New Advent)