When the Philistines captured the ark of God, they brought it from Ebenezer to Ashdod; then the Philistines took the ark of God and brought it into the house of Dagon and placed it beside Dagon. When the people of Ashdod rose early the next day, there was Dagon, fallen on his face to the ground before the ark of the Lord. So they took Dagon and put him back in his place. But when they rose early on the next morning, Dagon had fallen on his face to the ground before the ark of the Lord, and the head of Dagon and both his hands were lying cut off upon the threshold; only the trunk of Dagon was left to him. This is why the priests of Dagon and all who enter the house of Dagon do not step on the threshold of Dagon in Ashdod to this day. The hand of the Lord was heavy upon the people of Ashdod, and he terrified and struck them with tumors, both in Ashdod and in its territory.And when the inhabitants of Ashdod saw how things were, they said, “The ark of the God of Israel must not remain with us; for his hand is heavy on us and on our god Dagon.” So they sent and gathered together all the lords of the Philistines, and said, “What shall we do with the ark of the God of Israel?” The inhabitants of Gath replied, “Let the ark of God be moved on to us.” So they moved the ark of the God of Israel to Gath. But after they had brought it to Gath, the hand of the Lord was against the city, causing a very great panic; he struck the inhabitants of the city, both young and old, so that tumors broke out on them. So they sent the ark of the God of Israel to Ekron. But when the ark of God came to Ekron, the people of Ekron cried out, “Why have they brought around to us the ark of the God of Israel to kill us and our people?” They sent therefore and gathered together all the lords of the Philistines, and said, “Send away the ark of the God of Israel, and let it return to its own place, that it may not kill us and our people.” For there was a deathly panic throughout the whole city. The hand of God was very heavy there; those who did not die were stricken with tumors, and the cry of the city went up to heaven. (1 Samuel 5:1-12, NRSV)
The Ark was taken by the Philistines to Ashdod and placed in their holy place. And once there, God caused their god to worship.
And when the Philistines corrected what they saw as wrong, God had their god worship again, and this time God removed the head and hands of the statue.
You see God can and will work through all situations. When the Philistines removed the Ark from Ashdod, God continued the plagues against those who would try to keep God from His people.
So trust in God and know that He is always for you!