Genesis 35:2

Then Jacob said unto his household, and to all that were with him, Put away the strange gods that are among you, and be clean, and change your garments:

After his sons' cruel revenge on the Shechemites had exposed him and his house to danger of destruction by the surrounding nations, humbled and distressed Jacob called upon God and was told to go to Bethel, requiring his family to humble themselves with him before going. The verse records his command to his household and to all that were with him to put away the strange gods that were among them, and to be clean and change their garments, before going to Bethel to worship God. That command confronted the idolatry present in his family, with his sons themselves affected by it to some degree, and called them to prepare themselves for the journey and for worship. To be clean and to change garments meant to lay off sin, and it accompanied the removal of spiritual defilement by humbling themselves and laying aside all ornaments, including earrings.

This cleansing prepared them to go to Bethel for Jacob to make atonement for their sins by sacrifice, seeking God's mercy and protection so that He would be entreated for them and not leave them to be destroyed. The household obeyed by surrendering to Jacob all the foreign gods in their hands and all their earrings, which he hid and buried under the oak near Shechem, where they were never found again. God accepted Jacob's effort to remove the wrong from his family, appearing to him and blessing him and renewing the promise to him, and He put His terror upon the cities round about so that they did not pursue Jacob's sons.