“he put darkness.” Joshua switches from God in the first person to God in the third person, “he.”
“between you and the Egyptians.” Although most of the people with Joshua were dead, some were likely under 20 at the time of the Exodus and thus alive with Joshua, having seen the plagues and the Exodus. Also, the Jewish people tend to see themselves as part of the Exodus.
“And your eyes saw what I did.” There are many examples in history of the power of God and the futility of fighting against Him. The wise believer submits to God and obeys Him. Even if it is hard at first due to our sin nature and human stubbornness, in the end, there is true peace in following God. In contrast, the end of standing arrogantly against God is destruction.