A visitor writes,
"whats psalms 40 is saying"
Psalm 40 is a psalm of David which contains Messianic prophecy.
1 I waited patiently for the LORD; and he inclined unto me, and heard my cry.
2 He brought me up also out of an horrible pit, out of the miry clay, and set my feet upon a rock, and established my goings.
3 And he hath put a new song in my mouth, even praise unto our God: many shall see it, and fear, and shall trust in the LORD.
Verses 1 to 3 speak of God rescuing both David and Christ from adverse circumstances.
4 Blessed is that man that maketh the LORD his trust, and respecteth not the proud, nor such as turn aside to lies.
Verse 4 shows that triumph comes from trusting God.
5 Many, O LORD my God, are thy wonderful works which thou hast done, and thy thoughts which are to us-ward: they cannot be reckoned up in order unto thee: if I would declare and speak of them, they are more than can be numbered.
Verse 5 - God’s wonderful works to men are without number.
6 ¶ Sacrifice and offering thou didst not desire; mine ears hast thou opened: burnt offering and sin offering hast thou not required.
7 Then said I, Lo, I come: in the volume of the book it is written of me,
8 I delight to do thy will, O my God: yea, thy law is within my heart.
Verses 6 to 8 is a Messianic prophecy which foretells the end of the Mosaic sacrifices through the sacrifice of Christ; as revealed in the letter to the Hebrews.
Hebrews 10:5 Wherefore when he cometh into the world, he saith, Sacrifice and offering thou wouldest not, but a body hast thou prepared me: 6 In burnt offerings and sacrifices for sin thou hast had no pleasure. 7 Then said I, Lo, I come (in the volume of the book it is written of me,) to do thy will, O God. 8 Above when he said, Sacrifice and offering and burnt offerings and offering for sin thou wouldest not, neither hadst pleasure therein; which are offered by the law; 9 Then said he, Lo, I come to do thy will, O God. He taketh away the first, that he may establish the second. 10 By the which will we are sanctified through the offering of the body of Jesus Christ once for all.
9 I have preached righteousness in the great congregation: lo, I have not refrained my lips, O LORD, thou knowest.
10 I have not hid thy righteousness within my heart; I have declared thy faithfulness and thy salvation: I have not concealed thy lovingkindness and thy truth from the great congregation.
Verses 9 and 10 are true of both David and Christ.
11 ¶ Withhold not thou thy tender mercies from me, O LORD: let thy lovingkindness and thy truth continually preserve me.
12 For innumerable evils have compassed me about: mine iniquities have taken hold upon me, so that I am not able to look up; they are more than the hairs of mine head: therefore my heart faileth me.
13 Be pleased, O LORD, to deliver me: O LORD, make haste to help me.
14 Let them be ashamed and confounded together that seek after my soul to destroy it; let them be driven backward and put to shame that wish me evil.
15 Let them be desolate for a reward of their shame that say unto me, Aha, aha.
16 Let all those that seek thee rejoice and be glad in thee: let such as love thy salvation say continually, The LORD be magnified.
17 But I am poor and needy; yet the Lord thinketh upon me: thou art my help and my deliverer; make no tarrying, O my God.
Verses 9 to17 are prayer requests of both David and Christ.
Hebrews 5:7 Who in the days of his flesh, when he had offered up prayers and supplications with strong crying and tears unto him that was able to save him from death, and was heard in that he feared;
I hope this helps