Joshua 23:6
Be ye therefore very courageous to keep and to do all that is written in the book of the law of Moses, that ye turn not aside therefrom to the right hand or to the left; Be ye therefore very courageous to keep and to do all that is written in the book of the law of Moses, that ye turn not aside therefrom to the right hand or to the left;
The verse commands Israel to be very courageous to keep and to do all that is written in the book of the law of Moses, without turning aside from it to the right hand or to the left. The courage called for meant continuing the difficult work of driving out the remaining idolatrous Canaanite nations rather than settling into ease, for further conflicts still lay ahead. If Israel obeyed and remained true, God would accompany them with His presence and power, expelling those nations and giving them the land as He had promised.
The command warns against idolatry by requiring avoidance of entangling ties with idolaters, including intermarriage, and keeping away from even the appearance and the borders of sin, because such contact corrupts. Departing from God brings desolation and ruin, while God is faithful both to fulfill His promises and to carry out His warnings and threats. This warning and lesson applies personally to each individual.