Numbers 25 - 26
Many sons of Israel play the harlot with the daughters of Moab and Midian, and even then they started bowing down to worship Baal, and some 24,000 died from God’s judgement. Phinehas, the grandson of Aaron, pleases God by acting to kill a leader in the tribe of Simeon, who was flaunting his illicit relationship with the daughter of a Midianite king.
In Numbers 26 we see the second census of Israel, which is happening at the end of their 40 years of wandering, and in preparation for the people to go into the land of promise. The census of fighting age men was virtually the same as it had been 40 years earlier, with 601k men. With this census, God provides instruction on how the land of Canaan will be divided between the tribes.