Notice the heading of this Psalm; (these are inspired). God could just as easily have given David these words when all was quiet and happy, but He gave them to him when he was really in trouble. Take a few minutes and turn to another example of difficult days producing more praise and worship to God than days of great blessing. 2 Sam. 22:2-51 (50 verses). Praise after his troubles. Chapter 23:1-7 (7 verses) after success and blessing. Do you get the point in your life?
V.5 Although David was in real trouble, he awakens happy and fearless. The night is passing and the morning has come.