18 Otherwise, they will teach you to follow all the detestable things they do in worshiping their gods, and you will sin against the LORD your God.

Read Deuteronomy 20:18 Using Other Translations

That they teach you not to do after all their abominations, which they have done unto their gods; so should ye sin against the LORD your God.
that they may not teach you to do according to all their abominable practices that they have done for their gods, and so you sin against the LORD your God.
This will prevent the people of the land from teaching you to imitate their detestable customs in the worship of their gods, which would cause you to sin deeply against the LORD your God.