God told Abraham in Gen 22:
Here is one possibility:
Abraham took some servants and Isaac and headed for Moriah.2He said, “Take your son, your only son Isaac, whom you love, and go to the land of Moriah, and offer him there as a burnt offering on one of the mountains of which I shall tell you.”
In Abraham's head, what did he mean by that?4On the third day Abraham lifted up his eyes and saw the place from afar. 5Then Abraham said to his young men, “Stay here with the donkey; I and the boy will go over there and worship and come again to you.”
Here is one possibility:
God will provide the lamb in place of Isaac. That's exactly what transpired next:6And Abraham took the wood of the burnt offering and laid it on Isaac his son. And he took in his hand the fire and the knife. So they went both of them together. 7And Isaac said to his father Abraham, “My father!” And he said, “Here I am, my son.” He said, “Behold, the fire and the wood, but where is the lamb for a burnt offering?” 8Abraham said, “God will provide for himself the lamb for a burnt offering, my son.” So they went both of them together.
At the last second:9When they came to the place of which God had told him, Abraham built the altar there and laid the wood in order and bound Isaac his son and laid him on the altar, on top of the wood. 10Then Abraham reached out his hand and took the knife to slaughter his son.
Abraham passed the test.11But the angel of the LORD called to him from heaven and said, “Abraham, Abraham!” And he said, “Here I am.” 12He said, “Do not lay your hand on the boy or do anything to him, for now I know that you fear God, seeing you have not withheld your son, your only son, from me.”
There is another possibility, Heb 11:13 And Abraham lifted up his eyes and looked, and behold, behind him was a ram, caught in a thicket by his horns.
Even if Abraham had gone ahead and slaughtered his son, he believed that God could resurrect him. In either case, Abraham had great faith in God.17By faith Abraham, when he was tested, offered up Isaac, and he who had received the promises was in the act of offering up his only son, 18of whom it was said, “Through Isaac shall your offspring be named.” 19He considered that God was able even to raise him from the dead, from which, figuratively speaking, he did receive him back.