The first story, the story of Habil and qabil in Al Maidah verse 27. In this story the lesson that can be taken is that Allah SWT only accepts qurban from the godly.
وَاتْلُ عَلَيْهِمْ نَبَأَ ابْنَيْ آدَمَ بِالْحَقِّ إِذْ قَرَّبَا قُرْبَانًا فَتُقُبِّلَ مِنْ أَحَدِهِمَا وَلَمْ يُتَقَبَّلْ مِنَ الْآخَرِ قَالَ لَأَقْتُلَنَّكَ ۖ قَالَ إِنَّمَا يَتَقَبَّلُ اللَّهُ مِنَ الْمُتَّقِينَ
“And tell them the true story of the two sons of Adam, when they offered the Qurban, so one of them was accepted and the other was not accepted. He said, “Indeed, I will kill you.” He said, “God only accepts from the godfearing.”
For it shall not come to God the flesh and blood of the animal. But what comes to this is the piety that is in the heart.
“The condition of piety is sincere. And in the Qurban there is a test of sincerity. Berqurban can be blatant with the intention of encouraging others with a live broadcast,” he said.
The second story is the sacrifice of the heifer by the Children of Israel. In Al Baqarah verses 67-68, the wisdom of qurban here is whatever the problem, the solution is obedience to Allah SWT,
وَإِذْ قَالَ مُوسَىٰ لِقَوْمِهِ إِنَّ اللَّهَ يَأْمُرُكُمْ أَنْ تَذْبَحُوا بَقَرَةً ۖ قَالُوا أَتَتَّخِذُنَا هُزُوًا ۖ قَالَ أَعُوذُ بِاللَّهِ أَنْ أَكُونَ مِنَ الْجَاهِلِينَ.قَالُوا ادْعُ لَنَا رَبَّكَ يُبَيِّنْ لَنَا مَا هِيَ ۚ قَالَ إِنَّهُ يَقُولُ إِنَّهَا بَقَرَةٌ لَا فَارِضٌ وَلَا بِكْرٌ عَوَانٌ بَيْنَ ذَٰلِكَ ۖ فَافْعَلُوا مَا تُؤْمَرُونَ
“And (remember) when Moses said to his people, “Allah commands you to slaughter a cow. They said, “Are you going to mock us?” He said, “I seek refuge in Allah lest he should be of the ignorant.
They said, “Call upon your Lord for us that He may make clear to us what she is. He said, “He said, “She is neither old nor young. So do as you are commanded.”
This verse explains how to involve God both personally, family, and nation and country. The way out is to obey Allah SWT.
Obeying Allah will ease hardship, remove sin and multiply the reward. Slaughtering qurban is an example of sharia learning to obey without much dispute.
And when Abraham was commanded to slaughter his son Ishmael, he said, “O my people! So Abraham did this in a righteous manner. In As Saffat verse 102 it is mentioned:
فَلَمَّا بَلَغَ مَعَهُ السَّعْيَ قَالَ يَا بُنَيَّ إِنِّي أَرَىٰ فِي الْمَنَامِ أَنِّي أَذْبَحُكَ فَانْظُرْ مَاذَا تَرَىٰ ۚ قَالَ يَا أَبَتِ افْعَلْ مَا تُؤْمَرُ ۖ سَتَجِدُنِي إِنْ شَاءَ اللَّهُ مِنَ الصَّابِرِينَ
“So when he reached the age of old, he said, “O my son! I have dreamed that I would slaughter you. So think about what you think.” He said, “O my father! Do as You are commanded. God willing, you will find me one of the patient.”
He said, “O My people, indeed I have been commanded to be of those who do good.” But he asked his son.
He wanted to see the extent of Ishmael’s piety and his sincerity in keeping with God’s command without coercion from his father. So that whatever will be done will go well and not painfully like slaughtering qurban animals with a sharp knife and once slashed.