So the men of Kiriath-jearim came for the ark of the Lord and took it to Abinadab's house on the hill. They consecrated his son Eleazar to take care of it.
References for 1 Samuel 7:1
Time went by until 20 years had passed since the ark had been taken to Kiriath-jearim. Then the whole house of Israel began to seek the Lord.
References for 1 Samuel 7:2
Samuel told them, "If you are returning to the Lord with all your heart, get rid of the foreign gods and the Ashtoreths that are among you, dedicate yourselves to the Lord, and worship only Him. Then He will rescue you from the hand of the Philistines."
References for 1 Samuel 7:3
So the Israelites removed the Baals and the Ashtoreths and only worshiped the Lord.
References for 1 Samuel 7:4
Samuel said, "Gather all Israel at Mizpah, and I will pray to the Lord on your behalf."
References for 1 Samuel 7:5
When they gathered at Mizpah, they drew water and poured it out in the Lord's presence. They fasted that day, and there they confessed, "We have sinned against the Lord." And Samuel [began to lead] the Israelites at Mizpah as [their] judge.
When the Philistines heard that the Israelites had gathered at Mizpah, their rulers marched up toward Israel. When the Israelites heard [about it], they were afraid because of the Philistines.