Jesus tells his disciples they will governors and kings, to bear witness. The twelve disciples would be rightly concerned how they would behave when they are brought before these authorities, so Jesus tells then the Holy Spirit will guide their speech.
“Do not be anxious” also appears in Matthew 6:25, do not be anxious about your life, food drink or clothing. Just as the disciples are not to worry about their physical needs (God will provide), they do not need to worry about the words they will speak to the people who have the power to kill them because the Holy Spirit will be speaking through them.
In Acts 4 Peter and John are brought before the high priest and a few of the Temple aristocracy. When he is asked by what authority he speaks, Peter is “filled with the Holy Spirit” (4:8) and he bears witness to the death and resurrection of Jesus (4:8-12). Those who heard the speech were astonished that an unschooled man would have that kind of courage to speak as he did (4:13-17). When he is told to stop speaking in the name of Jesus, Peter boldly says he will continue preaching in Jesus’s name (4:18-20).
I have occasionally heard this verse misused by people who downplay preparing academically for preaching and teaching the Bible. I have talked to pastors who claim that they do very little preparation, they just let the Holy Spirit lead. That is not what this verse is talking about! These disciples will be dragged before authorities and they will give bold testimony through the power of the Holy Spirit, but the Spirit is calling to mind things they have learned from Jesus in the first place! When a pastor tells me they like to let the Spirit lead, I usually tell them they should give the Holy Spirit something to work with (and seriously prepare themselves to preach).
Not only with the disciples be threatened by local Jewish councils and Gentile courts, but they will also be ostracized from their families. Jesus then tells his disciples that “everyone who endures will be saved” (10:21-23).
Is there an allusion to Deuteronomy 13:6-11 here? In that passage Moses warns against family members and friends enticing a person to worship an idol. Do not listen to that person, they are to be killed! If the local Jewish councils and synagogues think the preaching of the disciples is in some way idolatrous, would they think they are following the principle of Deuteronomy 13:6-11 when they try to correct the disciples with physical punishment and even death?
Most commentaries detect an allusion to Micah 7:6, sons and daughters rise up against their family, even neighbors cannot be trusted. “But as for me, I will look to the LORD; I will wait for the God of my salvation; my God will hear me” (Mic 7:7). The parallel is closer in the LXX.
Everyone will hate the disciples “for my name’s sake.” As he will say in v. 24, it is the preaching of Jesus that causes the persecution. If you suffer on account of your testimony for Jesus and the gospel, then that is a good thing; if you suffer because you did something stupid, then that is not the kind of suffering Jesus is talking about. If you are caught speeding, you cannot claim you are suffering persecution from the pagan government and somehow this passage applies.
Here is a very 2021 analogy, if you do not like it, move on to the next paragraph. If you joined a riot and broke into a federal building, destroyed federal property and looted things from government offices, then you are going to suffer. Your family might even turn you in to the FBI when they see your social media posts! This is not a fulfillment of Matthew 10:21-23: you did something that deserves punishment, jail time, etc.
Jesus is describing suffering on account of his name, unjust punishments and even execution as a result of preaching the Gospel. Some Christians claim this verse when people hate them, but Jesus is not talking about being hating because you are a jerk. This hatred is based toward the disciples of Jesus for being a disciple of Jesus.
Jesus promises the disciples that they will be saved, but from what? This cannot refer to being saved from persecution or death since some will die (Stephen, Acts 7:59-60; James, Acts 12:1). When a town begins to persecute them, the disciples are to flee and go to another town. On the one hand, Jesus has already prohibited retaliation in 5:39 (so no fighting back against one’s oppressor).
This section began with an admonition to be wise as a serpent. If a town is aggressively persecuting the disciples on account of the name of Jesus, perhaps the wise course of action is to leave (Nolland, Matthew, 427). It is a misuse of this verse to claim that a disciples of Jesus ought to put themselves in dangerous positions of intentionally break laws to preach the gospel. The disciple who is wise learns how to navigate a culture so that they can maximize their chances for reaching the lost with the Gospel of Jesus.