David sinned. The Lord is disciplining him with a painful illness. His enemies are using these as a means to dispose of him. Sometimes no defense, answers, or rebuttals are the only things that can be done. That is what David is saying in verses. The only things I can do when much is taken away is put my hope in the Lord Jesus and pray.
Psalm 55:22 states, “Cast your cares on the LORD and he will sustain you; he will never let the righteous fall.” And Apostle Peter wrote, “Humble yourselves, therefore, under God’s mighty hand, that he may lift you up in due time.
Cast all your anxiety on him because he cares for you.” (1 Peter 5:6-7)