Scripture can help, but usually it takes more than that. A lot of people self-deceive themselves about being righteous through scripture, and can't account themselves properly.Like this,
'Ask your own conscience when was the time, and where was the place, that you ever solemnly took your heart to task and examined it by Scripture?' (Richard Baxter).
'When we see ourselves deceived in our expectations, it becomes us to reflect, with shame, upon our security as our folly, as David does here, that we may be wiser another time and may rejoice in our prosperity as though we rejoiced not, because the fashion of it passes away.' (Matthew Henry).
I think it's like that.
The light of God's face (the other side of the reminder coupled with the written reminder and God's word brought to life) is needed. Without reflection from the guide, it is difficult to not deceive ourselves.
Taking refuge in God means we should see how disrespectful we been towards his sanctity and seek forgiveness for it.
If we fail to attain righteousness and proximity to God through actions, then we should ask God to take our admission of our sinful nature as it is and admission of the great evil of violating sanctity of God and his beautiful chosen names/lights as a means that God will still forgive us and that our confession will bring us close to him and purify us of our sins.
But not admitting evil and not attaining righteousness, both, this is too much and forgiveness loses its value if everyone is simply forgiven.