Abraham was considered a hero of the faith, named as such in the book of Hebrews in the New Testament.
But that doesn't mean he was perfect.
Abraham had previously acted like his wife was his sister and let his wife be taken by the Egyptian king. God luckily protected her, and she was released back to her husband.
Wonderful things happened in life, and still Abraham struggled to trust God. He got scared again that someone would kill him to get his wife, who was now 90, and he again acted like she was his sister. Again, she was taken into the king's harem.
God went to the king in a dream and warned him what he had done. He was guilty of taking another man's wife, when though he didn't mean to do it. Sometimes we are guilty of sin when when we don't consciously choose to sin or feel bad about something. Unintentional sin is still sin. Honestly that's the most common kind; they are accidents but we still have to pay for those choices.
Sometimes though, God graciously protects us from sin and disaster. God had not let Abimilech sleep with Sarah yet. He protected the king from unintentional adultery. I often think when I encounter delays and setbacks, like getting stuck in traffic, that maybe it is because God is protecting me from something. It might be from danger. It might be from a situation that would get me involved in sin. Who knows? But if God is in charge, we have to believe he is in charge of every little thing.
Abraham actually admitted that he had claimed Sarah as his sister wherever they went. He was a coward over and over again, and he made his wife suffer because of his sin. Sin doesn't just affect us, it affects those around us, especially those we love.
I often struggle with laziness, wanting to watch TV and relax instead of doing chores at home. That in turn affects my husband, who either has to take on what I didn't do or has to live in a dirty home. It means we don't invite people over when we should because the house isn't ready to receive guests. My sin affects others.
Another point from Abraham's story --- truths intended to deceive are still a lie. Yes, Sarah was his sister, but saying she was his sister instead of his wife was a deception. It was a sin. We are supposed to let our yes be yes and no be no. Christians are supposed to be honest.
The story ends with Abimilech apologizing and giving Abraham 1,000 pieces of silver. He prayed for the king, and God answered by healing Abimilech and the curse that was on his household because of Sarah. God didn't give up on Abraham. God doesn't give up on us.