God instructed Israel to put these people to death (see Deut. 20:16–18). Skeptics often accuse God of sanctioning genocide. However, if God treated any of us according to our sins, we would not only be put to death (see Rom. 6:23), we would be justly condemned to hell. All of God’s judgments are true and righteous altogether (see Psa. 19:9). None of them are unjust, including this instruction to Israel.
Joshua 16:10 And they did not drive out the Canaanites who dwelt in Gezer; but the Canaanites dwell among the Ephraimites to this day and have become forced laborers.