Genesis 20:6 reads as follows:

And God said unto him in a dream, Yea, I know that thou didst this in the integrity of thy heart; for I also withheld thee from sinning against me: therefore suffered I thee not to touch her.

So very much is said in this one verse. Wow! How many times in our life does God keep us from falling into life altering sins? The split second of acting on some sins changes our life forever. Only God can guide as we need. This is why it is crucial for each of us to stay so close to Him by prayer and the study of His word. Then we see things as He does and we tilt our mind a little His way and not so much toward ours.