This brings to mind a Scripture verse I memorized in my youth: “Thy word I have hid in my heart that I might not sin against thee” (Psalm 119:11) I’m not sure of the translation except I see it’s not the RSV.
A few decades ago I chose to memorize the same passages you shared here along with many others. Verse by verse, day by day. The words have stuck even if the references may not have. Once the words are in our hearts, the Holy Spirit can help us remember them to keep us from sin, as your post has demonstrated.