This verse comes as Joshua tells the Israelites about what God has done for them since the beginning: bringing Abraham into a new land and sending the Jewish people out of Egyptian bondage, through Moses and Aaron, to where they were presently—following Joshua to the God’s Promised Land.
Joshua had witnessed several shameful behaviors exhibited by the Israelites as they wandered the wilderness with Moses, from the creation of the Gold Calf to what he had seen prior to his statements from the Lord in Joshua 24. He pleads with his people to turn away from the gods their fathers worshipped while in Egypt and while traveling in the wilderness. (Josh. 24:14) His hope was to show them through his re-visited history about God’s love and provision in their lives and in their ancestors’ lives, that it was better to serve the Lord who took care of them than false gods who “demanded” unholy sacrifices but did little to help.
His concluding statements to the Israelites are for this day of his speech to mark who will be following God in service and who will continue the treacherous path of serving false gods, bolding claiming his family would be serving the Lord. (Josh. 24:15)