Numbers 14 - 15
The multitude of the people rebelled against God and Moses, and in spite of the pleading of Joshua and Caleb, they refused to go into the land God had led them to. It’s an incredible thing to contemplate all of the miracles God had done in the sight of these people, not only in rescuing them out of slavery to Egypt, and taking them through the Red Sea, but in many miraculous ways the previous year. Yet they were blind to the love and power of God, and so God condemned all of the adults to die in the wilderness before their children would be taken into the promised land. This would be accomplished over the next 38+ years, while God continued to lead and provide for them.
Why do you think God took 40 years to let those rebellious and ungrateful people gradually die off, rather than just striking them all dead in judgement, and then taking the children in at that time?