We all have dreams but the dreams of Prophets are Wahi or revelation. This means a Prophet’s dream can be a command from Allah and their dreams are always true.
Prophet Ibrahim (as) had a dream in which he was sacrificing his son. When Ibrahim (as) woke up he was really worried, especially because he loved his son Ismael so much.
Ibrahim (as) had the same dream a few times and knew that Allah was commanding him to sacrifice his son. Ibrahim (as) loved his son so much but he would never disobey Allah.
Allah was testing Ibrahim (as) to see if he would sacrifice his son and obey Allah’s command.
Ibrahim (as) made his preparation for the sacrifice. Soon both father and son were on their way to the place of sacrifice. As they both walked, the Shaytan came to Ibrahim (as) and reminded him how much he loved his son. Ibrahim (as) chased the Shaytan away by throwing stones at him. This happened three times.
Finally, they both arrived at the place of sacrifice and Ibrahim (as) got ready to make the sacrifice. Allah saw that Ibrahim (as) would follow His command no matter what situation he is in. Allah sent the Angel Jibrael down from the skies with a ram and commanded Ibrahim (as) to sacrifice the ram instead. This meant that the sacrifice was accepted by Allah and that Ibrahim (as) had passed this test.
Allah liked the actions of Ibrahim (as) so much that Allah commanded the Muslims to do these actions as well. Hajjis throw stones at three pillars which represent the shaytan. They also sacrifice an animal when the Hajj is completed. We still love and respect prophet Ibrahim (as) who was a great prophet of Allah.