Prophet Ibrahim (AS) was commanded to sacrifice his son Ismael (AS). Allah of course, never intended the slaughter to take place. He just wanted to test the submission and loyalty towards Him and purify the heart of Ibrahim (AS) from every attachment and love besides Him. Ibrahim (AS) surrendered to the commands of Allah without any hesitation and prepared himself and his son for sacrifice.
The slaughter of animal signifies the slaughter of nafs by Prophet Ibrahim (AS). Muslims perform the sacrifice and celebrate the occasion of Eid-ul-Adha every year on the day of 10th Dhul Hijjah.
Sacrifice purifies heart. You must be able to give from the things you love. We only reach goodness through sacrifice. Allah never wanted to slaughter Ismael (AS) neither He wants the blood of an animal being sacrificed. He just wanted to purify the heart of Ibrahim (AS). The act of Hajj Qurbani holds special significance and symbolizes unconditional love and faith towards Allah (SWT). The obligatory ritual of the sacred slaughter after Hajj is extremely important. Other than the Hady sacrificial animal in Hajj, one has to give up many things. You have to sacrifice time, money, health and so on.