When Abraham was young, his father strayed from the faith and gave Abraham as a sacrifice. But the Lord saved Abraham from this aweful situation:
Abraham 1:5-19
5 My fathers, having turned from their righteousness, and from the holy commandments which the Lord their God had given unto them, unto the worshiping of the gods of the heathen, utterly refused to hearken to my voice;
6 For their hearts were set to do evil, and were wholly turned to the god of Elkenah, and the god of Libnah, and the god of Mahmackrah, and the god of Korash, and the god of Pharaoh, king of Egypt;
7 Therefore they turned their hearts to the sacrifice of the heathen in offering up their children unto these dumb idols, and hearkened not unto my voice, but endeavored to take away my life by the hand of the priest of Elkenah. The priest of Elkenah was also the priest of Pharaoh.
8 Now, at this time it was the custom of the priest of Pharaoh, the king of Egypt, to offer up upon the altar which was built in the land of Chaldea, for the offering unto these strange gods, men, women, and children.
9 And it came to pass that the priest made an offering unto the god of Pharaoh, and also unto the god of Shagreel, even after the manner of the Egyptians. Now the god of Shagreel was the sun.
10 Even the thank-offering of a child did the priest of Pharaoh offer upon the altar which stood by the hill called Potiphar’s Hill, at the head of the plain of Olishem.
11 Now, this priest had offered upon this altar three virgins at one time, who were the daughters of Onitah, one of the royal descent directly from the loins of Ham. These virgins were offered up because of their virtue; they would not bow down to worship gods of wood or of stone, therefore they were killed upon this altar, and it was done after the manner of the Egyptians.
12 And it came to pass that the priests laid violence upon me, that they might slay me also, as they did those virgins upon this altar; and that you may have a knowledge of this altar, I will refer you to the representation at the commencement of this record.
13 It was made after the form of a bedstead, such as was had among the Chaldeans, and it stood before the gods of Elkenah, Libnah, Mahmackrah, Korash, and also a god like unto that of Pharaoh, king of Egypt.
14 That you may have an understanding of these gods, I have given you the fashion of them in the figures at the beginning, which manner of figures is called by the Chaldeans Rahleenos, which signifies hieroglyphics.
15 And as they lifted up their hands upon me, that they might offer me up and take away my life, behold, I lifted up my voice unto the Lord my God, and the Lord hearkened and heard, and he filled me with the vision of the Almighty, and the angel of his presence stood by me, and immediately unloosed my bands;
16 And his voice was unto me: Abraham, Abraham, behold, my name is Jehovah, and I have heard thee, and have come down to deliver thee, and to take thee away from thy father’s house, and from all thy kinsfolk, into a strange land which thou knowest not of;
17 And this because they have turned their hearts away from me, to worship the god of Elkenah, and the god of Libnah, and the god of Mahmackrah, and the god of Korash, and the god of Pharaoh, king of Egypt; therefore I have come down to visit them, and to destroy him who hath lifted up his hand against thee, Abraham, my son, to take away thy life.
18 Behold, I will lead thee by my hand, and I will take thee, to put upon thee my name, even the Priesthood of thy father, and my power shall be over thee.
19 As it was with Noah so shall it be with thee; but through thy ministry my name shall be known in the earth forever, for I am thy God.
From this we see that Abraham was well aware of the evils of human sacrifice. So when God asked him to sacrifice his only son from Sarah, He probably had a very difficult time with this commandment from God. But Abraham knew God and had heard his voice. Therefore he knew God was the true and living God and that he should obey him. But why would God put Abraham through such an ordeal?
God did this to let Abraham know what it was like for the Father to sacrifice his only begotten son Jesus Christ. It was difficult for the Father to see his only begotten son suffer as he did. In this way God was able to convey his feelings to Abraham and let him know that it was truly a sacrifice even for the Father of us all to see his most faithful son suffer and die for the sins of the world. God never intended for Abraham to kill his son. He only wanted him to understand what he was going through as a Father.
Jacob 4:4-5
4 For, for this intent have we written these things, that they may know that we knew of Christ, and we had a hope of his glory many hundred years before his coming; and not only we ourselves had a hope of his glory, but also all the holy prophets which were before us.
5 Behold, they believed in Christ and worshiped the Father in his name, and also we worship the Father in his name. And for this intent we keep the law of Moses, it pointing our souls to him; and for this cause it is sanctified unto us for righteousness, even as it was accounted unto Abraham in the wilderness to be obedient unto the commands of God in offering up his son Isaac, which is a similitude of God and his Only Begotten Son.
Abraham was not an unfaithful servant but was very obedient to the will of God, even in the case of Hagar.
Doctrine and Covenants 132:34-36
34 God commanded Abraham, and Sarah gave Hagar to Abraham to wife. And why did she do it? Because this was the law; and from Hagar sprang many people. This, therefore, was fulfilling, among other things, the promises.
35 Was Abraham, therefore, under condemnation? Verily I say unto you, Nay; for I, the Lord, commanded it.
36 Abraham was commanded to offer his son Isaac; nevertheless, it was written: Thou shalt not kill. Abraham, however, did not refuse, and it was accounted unto him for righteousness.
Whatsoever the Lord God commands man to do is not sin. Abraham was very faithful to the Lord and is known as the Father of the Faithful.
Genesis 22:18
18 And in thy seed shall all the nations of the earth be blessed; because thou hast obeyed my voice.