In the Old Testament book of Genesis, Abraham is a devout follower of God (Yahweh). He and his wife Sarah wait many long years to have a child. In fact, they are so old, that when God, disguised as a traveler tells Abraham that he will be a father, Sarah overhears and laughs. However, Abraham and Sarah do have a son: they name him Isaac. (Isaac's name means "He laughed" because Abraham had also laughed when God first told him he would have a son.")
After several years, when Isaac is older, God tells Abraham to travel to the land of Moriah, where he will sacrifice his son on an alter. Abraham does as he is told. They travel for several days. On the third day, they reach the appointed spot. Abraham leaves his servants behind. When Isaac asks where the sacrifice is, his father replies that God will supply one.
Abraham builds the alter and ties his son on it. He is ready to kill the boy and start the fire beneath, but God's angel stops him. Nearby, a ram is caught by his horns in a bush nearby, and this becomes their sacrifice.
When Abraham is ready to carry out God's order, the scripture says:
'Do not lay your hand on the lad 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.' (RSV)
I do not take this to mean that Abraham is afraid of what God will do to him if he does not obey. I believe "fear" here is used differently. I believe the angel is saying that Abraham has proven his total devotion and respect for God.
In this context fear refers by metonymy to obedience that grows from faith.*
(Metonymy is a literary device that refers to...Using a vaguely suggestive, physical object to embody a more general idea. This means the the general word "fear" represents the larger idea of "obedience that grows from faith." See Dr. L. Kip Wheeler definition for more details.)
Abraham was ready to sacrifice his only, long-awaited son without question. In essence, it was a test, and God promises to reward Abraham greatly for his willingness to do what God asks of him, even if it is the most difficult thing.
I assume that you are asking about the part in Genesis 22 when Abraham is about to sacrifice his son Isaac because God has told him he must. He is about to kill Isaac when the angel stops him. He tells Abraham that he knows that Abraham fears God.
To say that someone fears God is to say that that person honors God and does what he or she thinks God wants done. In this case, Abraham has been willing to do the unthinkable (to kill his son), thus proving that he is willing to do what God says, no matter what. We can see this in what the angel says:
Now I know that you fear God, because you have not withheld from me your son, your only son.”
To fear God is to obey him -- perhaps out of fear of punishment or perhaps out of a desire to please him.