Psalm 40 is a song about those pits of life. Because David waited intensely on the Lord to rescue him and learned how to wait on the Lord to get him out of the pits of his life. So it is a psalm about what to do when you are in the pit of problems, situations and circumstances.