Joshua 24:17

For the LORD our God, he it is that brought us up and our fathers out of the land of Egypt, from the house of bondage, and which did those great signs in our sight, and preserved us in all the way wherein we went, and among all the people through whom we passed:

The words belong to Joshua's farewell address to all Israel and its leaders, spoken near the end of his life and before his death after the Lord had given Israel rest from its enemies, when he had assembled the host. Following the example of Moses, he recounted Israel's wilderness travels and God's merciful dealings with them, including how the king of Moab warred against them and called Balaam to curse them, but God refused to listen to Balaam and blessed them instead. He charged the people to choose between the gods their fathers served beyond the river and the gods of the Amorites or the Lord, declaring that he and his house would serve the Lord, and the verse is the people's answer to that call to choose.

In that answer Israel confesses that the Lord their God is the one who brought them and their fathers up out of the land of Egypt, from the house of bondage. They acknowledge that He did those great signs in their sight, performing great miracles before their eyes. They acknowledge that He preserved them and kept them safe in all the way wherein they went and among all the people and nations through whom they passed. They recall these acts as the reason they will not forsake the Lord for other gods but will serve Him and obey His voice, renewing on that ground their covenant to remain faithful and serve Him.

Joshua's review of God's providence throughout Israel's travels was meant to lead them to gratitude while also humbling them over their murmuring and failure to follow God's revealed will. In this setting he warned Israel against idolatry and tied departure from God to desolation, showing that God is faithful both to His promises and to His warnings. The same warning and lesson about gratitude, humility, and faithfulness to God applies to each person.