In Psalm 25 (A Psalm of David) David expresses trust in God (v1), he requests the Lord to shew him, to teach him (v4), to lead him (v5) and to remember him (v6).
Then he asks the Lord not to remember the sins of his youth nor his transgressions (v7) but not to forget he, himself, but rather to remember him according to mercy, for the sake of the Lord's goodness.
In particular, David makes two specific requests :
For thy name's sake, O Lord, pardon mine iniquity, for it is great. [Psalm 25:11 KJV]
Look upon mine affliction and my pain; and forgive all my sins. [Psalm 25:18 KJV]
It would seem that David is greatly troubled about his past sins (his youth) and about more recent transgressions. It would seem that he is in affliction and pain and that this is not from an external source but is a result, within him, of his own sins.
Why does David not simply go to the temple and make a sacrifice ?
Why does he make a direct request to the Lord : a personal request ?