Moses changed the name of Hoshea (Salvation) to Joshua (Jehovah Saves), and in so doing gave a picture of the coming Messiah.
First, consider the following: Israel coming out of Egyptian bondage going through the Red Sea, wandering in the wilderness, crossing the Jordan River, and entering the Land of Canaan, parallels the life of the church or the life of a Christian. Once we see this, we can see how Joshua was a type of the Christ.
First Corinthians 10 speaks of Israel’s baptism, and from this you can see the parallel between both the church and the life of a Christian with Israel’s experience,
Moreover, brethren, I do not want you to be unaware that all our fathers were under the cloud, all passed through the sea, all were baptized into Moses in the cloud and in the sea, all ate the same spiritual food, and all drank the same spiritual drink. For they drank of that spiritual Rock that followed them, and that Rock was Christ (1Co 10:1–4).
Herbert Lockyer argues that every time we see a reference to salvation in the Old Testament, in particular, “His salvation,” or some reference to God’s salvation, that we have a reference to Jesus as the Savior.
As stated above, Moses gave his successor a new name (Num 13.16). Also, Joshua is the Hebrew and Jesus is the Greek. Therefore, in places in the New Testament where the translation Joshua appears, it is the same word translated elsewhere as Jesus.
Matthew 1.21, I believe, shows the fulfillment of Joshua as the type and Jesus as the antitype,
“And she will bring forth a Son, and you shall call His name Jesus, for He will save His people from their sins” (Matt 1:21).
While Joshua might be a type of the Messiah, yet, the man in the Old Testament was only a man, and as such could not give the Israelites the final rest, which is what the Book of Hebrews argues (Heb 3 & 4), but Jesus the Messiah picks up where Joshua left off, and completes the job.