In the book of Exodus, we find out that the Israelites got frustrated with Moses’ absence after he went up the mountain for 40 days to get instructions from God. So, they melted their gold and Aaron shaped it into a golden calf. Moses comes back and expresses the fury of God and the Israelites involved are destroyed by God, except Aaron.
Why did God spare Aaron?
The Bible tells us why in Deuteronomy.
Deuteronomy 9:16 & 20 ~ “There below me I could see that you had sinned against the Lord your God. You had melted gold and made a calf idol for yourselves. How quickly you had turned away from the path the Lord had commanded you to follow!” “The Lord was so angry with Aaron that he wanted to destroy him, too. But I prayed for Aaron, and the Lord spared him.
So, according to Deuteronomy, God wanted to kill Aaron but Moses prayed for him and God listened.