Deuteronomy 12:29

When the LORD thy God shall cut off the nations from before thee, whither thou goest to possess them, and thou succeedest them, and dwellest in their land;

The Lord cuts off the nations from before Israel as Israel goes in to possess them, succeeds them, and dwells in their land, and the setting is Israel's inheritance of Canaan. The verse stands within a warning not to be ensnared by taking up the worship and practices of the nations thus displaced, and not to imitate the worship of the nations that were destroyed. That warning extends to representations and images connected with false worship.

Instead of such imitation, Israel was to obey God's commands. That obedience means keeping exactly what God commanded, without adding to it and without taking away from it.