Joshua 24:23
Now therefore put away, said he, the strange gods which are among you, and incline your heart unto the LORD God of Israel. Now therefore put away, said he, the strange gods which are among you, and incline your heart unto the LORD God of Israel.
This call belongs to Joshua's address to Israel and its leaders after the wars of conquest, when the Lord had given the people rest. In the wider passage he reviews God's care for Israel and warns against idolatry and the corrupting influence of idolaters. It is his loyal, faithful testimony given as light to those who had transgressed and mourned at Bochim, as his life of steadfast integrity was closing and the older generation who had crossed the Jordan were dying. It follows his warning that if Israel forsake the Lord and serve strange gods He will turn and hurt and consume them after doing them good, followed by their answer that they will serve the Lord and his declaration that they are witnesses against themselves that they have chosen the Lord. In the verse he charges those who have chosen the Lord to put away the strange gods among them and to incline the heart to the Lord God of Israel in wholehearted loyalty.
The people's renewed pledge to serve and obey God was made solemnly as a covenant, with a written record and a memorial stone standing as witnesses against denying Him. The verse belongs to a revival among God's ancient people, and all who profess Christ should search their own hearts whether they are in the faith by studying this account carefully and with understanding. The warning applies to avoiding close ties, including marriage, that expose a person to corruption, since even approaching the borders of sin can lead to ruin. Departure from God would bring desolation, and God is faithful both to fulfill His promises and to carry out His warnings.