Genesis 12:10
And there was a famine in the land: and Abram went down into Egypt to sojourn there; for the famine was grievous in the land. And there was a famine in the land: and Abram went down into Egypt to sojourn there; for the famine was grievous in the land.
A grievous famine came upon Canaan, and to preserve his household and flocks Abraham went down into Egypt to sojourn there for a time. His going was for temporary refuge from the severe dearth, not a forsaking of the land God had promised him. He did not abandon Canaan nor turn back to his former home in Chaldea, but purposed to return to the promised land.
The famine was another trial that tested his faith. Though he could not explain God's leadings and could not see his expectations fulfilled, he held fast to God's promise and would not allow circumstances to shake his trust. While he was in Egypt God gave him favor with the Egyptians, so that he came out with more than he had taken in. In that sojourn he stood as a representative through whom the God of heaven was revealed, and his life among the surrounding peoples made him a light to them. The account beginning here records his failure under temptation, showing that even one favored by God and entrusted with great responsibility could sin. That record of struggle and fall is preserved as a warning and lesson for later generations, and his experience encourages those who likewise struggle and fall to take heart and rise again through God's grace.