Genesis 26:2-3 records that when Isaac foolishly sought the help of Abimelech, the king of Gerar, instead of seeking the guidance of the Lord, when there was a famine in the land, the Lord appeared to Isaac. The Lord told Isaac, not to continue South into Egypt, but instead to dwell in the land that God was going to tell him about and then God assures Issac that he would bless Isaac and to his seed, would he give all these countries, as he will keep the promise made to his father Abraham.

Points to ponder:
Even when we take matters in our own hands and not trust in the Lord God wholeheartedly, unlike any man, God is loving and gracious and he appears to re-assure, that he is and will always be with us, no matter what. God appeared to us in the person of Jesus Christ, who promised us that the will never ever leave us.

Genesis 26:2-3 (KJV)
And the Lord appeared unto him, and said, Go not down into Egypt; dwell in the land which I shall tell thee of:
Sojourn in this land, and I will be with thee, and will bless thee; for unto thee, and unto thy seed, I will give all these countries, and I will perform the oath which I sware unto Abraham thy father;