Genesis 21:14
And Abraham rose up early in the morning, and took bread, and a bottle of water, and gave it unto Hagar, putting it on her shoulder, and the child, and sent her away: and she departed, and wandered in the wilderness of Beer-sheba. And Abraham rose up early in the morning, and took bread, and a bottle of water, and gave it unto Hagar, putting it on her shoulder, and the child, and sent her away: and she departed, and wandered in the wilderness of Beer-sheba.
Abraham sent Hagar and Ishmael away in obedience to God's direction and command, submitting because God required it. The separation caused him deep grief because he dearly loved his son, bowing his soul with grief and sorely testing his faith. Their departure was meant to restore peace in the household. Ishmael was not abandoned by God in being sent away; his life would be preserved, and he would become the father of a great nation.
The sending away to wander in the wilderness was an act of obedience in faith and one of the trials that preceded his later test. This earlier painful obedience is recalled as a test that was later surpassed by the command to offer Isaac.