God speaks encouragement to Joshua. He prepares to invade, and Israel agrees to follow him. He sends two spies to the first city of Jericho. A prostitute helps and hides them (and tells a blatant but justified lie in the process), believing their God to be real, and reporting that all Jericho is quaking in their boots over Israel. They promise to save her. Joshua has Israel cross the Jordan, the ark going before them and dividing the waters.
How this is about Jesus
Joshua is a preview of Christ. God speaks to Jesus, too, at the Jordan river at His baptism. He then invades Israel and gathers an army of disciples who help Him (including some unexpected sinners).
When we interact with Canaanites (unbelievers) we should not be discouraged and expect unexpected help. Our task is to be faithful to our leaders and our God.