I was reading about Abraham’s lie about Sarah being his sister in Genesis 20. Three things seem to be happening here all at the same time.
First, God was building Abraham’s character through the trial God put him through.
Second, God was preserving Abraham’s marriage by not allowing Abimelech to touch Sarah.
Third, God was keeping Abimelech from sinning so He will not have to punish him.
But while God was doing all these in the background, all Abraham could see was his own fear and a cowardly sense of self preservation.