David knew that God saved. He knew that he was anointed by Him and that no matter what happened, he was gonna be kept safe by God. David obviously kept himself in the word. I'm sure he read over and over again about how God saved the Israelites from Egypt, or how He saved Noah and his family from the flood. He knew the saving power of God! We have to understand that we are God's anointed as well and we will be saved from this sinful world. The day you gave your heart to Jesus you were saved. But as a constant reminder, we need to go to His word and be reminded of that. Read about the ones God saved in the past, but most importantly read about how Jesus was stretched out on the cross for you. I'm reminded that when we cried out to God, He answered from heaven. I'm reminded that as we cried out, He saved us by the one who is at His right hand.