Everyone goes through trials and tribulations, dark times and depression. If you haven't, you either haven't lived long enough or are lying to yourself. God doesn't promise that we won't have trials, but he does promise that he will be with us through them. Psalm 40 was written by David praising God after coming through one of his many trials.
Psalm 40 also reveals the blessing in the trial. Verse 3, "He has put a new song in my mouth, even praise to our God. Many shall see it, and fear, and shall trust in the Lord."
When God brings you through a difficult situation, you have a new testimony, a stronger witness, and a more confident faith. And as the Psalm states, we are to proclaim God's faithfulness and tell of his goodness to others, both for encouragement and to draw them to him. For as the angel speaking to the apostle John in Revelation 19:10 states, "the testimony of Jesus is the spirit of prophecy."
https://raisedtowalk.org/r40
More on Reading through the Psalms
https://raisedtowalk.org/psalms
Passages from the World Messianic Bible