Joshua 24:22

And Joshua said unto the people, Ye are witnesses against yourselves that ye have chosen you the LORD, to serve him. And they said, We are witnesses.

The verse belongs to Joshua's gathering of Israel after the wars of conquest had ended and the Lord had given the people rest from their enemies, near the end of his life. In that gathering he reviewed Israel's history and gave an earnest warning. That review was meant to awaken gratitude for God's care and humility over Israel's murmurings and failure to follow God's revealed will.

The people solemnly acknowledged that their own declaration to serve the Lord would stand as a witness against themselves if they failed to keep their pledge. That commitment was repeated with full awareness of its seriousness and the responsibility it carried. Joshua followed their pledge with a call to put away the strange gods among them and to turn their hearts to God. That call warned against idolatry and close ties with idolaters, including intermarriage, because such ties could corrupt them and lead to sin and ruin.

Israel was to shun even the appearance of evil rather than approach the borders of sin. God is faithful both to His promises and to His warnings, and turning from Him brings desolation. The chapter records a revival among God's ancient people. All who name the name of Christ should read it carefully and with an understanding heart while searching their own hearts whether they are in the faith, since the warning applies to each person.