Thousands of years ago, Prophet Ibrahim (AS), also known as Abraham and as Khalilullah (The friend of Allah), was living in what we now know as Iraq. He and his wife at the time (Sarah) were childless for several years, but later, by the will of Allah (SWT), he was blessed with a son (Ismail), after his second marriage to wife Hajar (Hagar).
Allah (SWT) had tested his faith through a dream he encountered one night. The dream commanded Ibrahim (AS) to sacrifice his beloved son, Ismail (AS), to show his love and devotion for Allah. Ibrahim (AS) had this dream for three consecutive nights, which is how he knew it was a command from Allah (SWT).
Allah (SWT) mentions this in The Holy Quran saying, "Then when (the son) reached the age to work with him, he said, 'O my son, indeed I have seen in a dream that I [must] sacrifice you. So see what you think.' He said, 'O my father, do as you are commanded. You will find me, if Allah wills, of the steadfast.'" [Quran 37:102]
One can only imagine how grand of a test this was for both father and son. Prophet Ibrahim (AS) was commanded to sacrifice the child he longed for, and Ismail (AS), being so young, accepted this command, showing immense faith by remaining steadfast. With this knowledge, they both set off to what Muslims believe was near Mina, a mountain located in Saudi Arabia. Ibrahim (AS) tied his son up and laid him down. As he prepared to carry out the sacrifice, he had a knife in his hands and a heart filled with sorrow, yet so much trust in his Lord. In that moment, something changed.
Allah called out to him with the following verses mentioned in the Quran "We called out to him, 'O Ibrahim! You have fulfilled the vision.' Indeed, We thus reward the doers of good. This was truly a revealing test. And We ransomed him with a great sacrifice." [Quran 37:104-107]
Instead of his son Ismail, Prophet Ibrahim (AS) found a ram in his place. This was a sign of acceptance, and the focus was not on the sacrifice itself but the submission to the will of Allah.
To this day, Muslims celebrate this event and get involved in the sacrifice of the animal in the name of Allah. This sacred act of sacrifice is what forms the heart of the Eid ul-Adha celebration across the world.