Summary: David asks for God's help. He knows that God teaches people how to act and certainly rescues those who seek His will.
Response: I have a hard time with this line of thinking. "I'm good, so save me" doesn't work if you're not good enough, and we soon find out that no one (except One, but He choose to save and not be saved) is good enough. But God chooses to save us anyways! Yes, I believe we should try to act godly, but not in order to be saved. It's the other way around: since we've been set free from sin, we are to actually stop sinning by relying fully in the power of God. It's a bit nuanced and might look the same on the outside, but whereas David is very raw, I tend to overthink.