Numbers 20:24
Aaron shall be gathered unto his people: for he shall not enter into the land which I have given unto the children of Israel, because ye rebelled against my word at the water of Meribah. Aaron shall be gathered unto his people: for he shall not enter into the land which I have given unto the children of Israel, because ye rebelled against my word at the water of Meribah.
Aaron was sentenced to die before Israel entered Canaan and not to enter the land given to Israel, because he and Moses rebelled against God's word at Meribah when bringing water from the rock. At Meribah God had commanded them to speak to the rock, but Moses struck it twice and spoke as if he and Aaron themselves would bring out the water, failing to trust God and honor Him before Israel, so Moses also was barred from entering the land and from leading the people in.
The sentence was carried out on Mount Hor, where Aaron was to be gathered to his people. By God's command Moses brought Aaron and his son Eleazar up the mountain, and Moses his brother and Eleazar his son went up with him and watched Aaron die. Before Aaron died Moses removed his priestly garments and put them on Eleazar, whom God had appointed to succeed Aaron in the priesthood and sacred office.
Moses together with Aaron's sons buried Aaron on the mount. The secluded burial on the mount kept the people from making too great ceremony over his body and becoming guilty of idolatry. Aaron's death and Eleazar's succession fulfilled the sentence, and Israel mourned Aaron for thirty days.