It's always vital to understand a verse or passage in its immediate context. Too often, verses are lifted out of their immediate context and prodded and twisted into a shape very different from what their context would allow.
Matthew 10:16-25
16 “Behold, I am sending you out as sheep in the midst of wolves, so be wise as serpents and innocent as doves.
17 Beware of men, for they will deliver you over to courts and flog you in their synagogues,
18 and you will be dragged before governors and kings for my sake, to bear witness before them and the Gentiles.
Jesus is speaking particularly to The Twelve here whom he has just commissioned to go out and proclaim that "the kingdom of heaven is at hand." (Matthew 10:5-15). He doesn't tell them to preach the Gospel because they didn't know at the time what it was; they had no idea of the atoning work of their Master that he had been sent from heaven to do; they knew nothing of the new, spiritual life that they would obtain by faith in him as their resurrected Lord and Savior.
19 When they deliver you over, do not be anxious how you are to speak or what you are to say, for what you are to say will be given to you in that hour.
20 For it is not you who speak, but the Spirit of your Father speaking through you.
Here, Christ enjoins his disciples to rest confident in the knowledge that the "Spirit of the Father" would speak through them in times of examination by civil authorities (governors, kings, etc.).
21 Brother will deliver brother over to death, and the father his child, and children will rise against parents and have them put to death,
The language here (brother, father, child, parents) indicates Jesus is speaking more broadly of the experience of all of his followers under persecution.
22 and you will be hated by all for my name’s sake. But the one who endures to the end will be saved.
What does it mean to be "saved," here? Does Jesus mean salvation in the Gospel sense? If so, how is the endurance of his disciples the means of their salvation? How does this square with the many verses and passages in the New Testament that locate salvation solely in the Person of Jesus Christ? (John 1:4; John 14:6; John 3:16; John 10:7-10; Acts 4:12; 1 Timothy 2:5, Ephesians 1:1-13, Hebrews 9-10:1-22, etc.) Are we to understand from what Jesus said to his disciples here that there are actually two Saviors, that they, and we, co-save ourselves by "enduring to the end"?
The way that I reconcile this verse (and others like it) to the many Bible verses that rule out self-salvation (aka - salvation by works: Ephesians 2:8-9; 2 Timothy 1:9; Titus 3:5-8; Romans 5:6-9), is to recognize that one "endures to the end" as a consequence of genuine, saving faith, a faith that is more than merely intellectual, a faith that anticipates concrete change as a consequence of what is believed. This is the sort of faith James wrote about in his infamous letter. It is faith that goes beyond nodding one's head and saying, "I agree"; it is faith that says also, "And so, I will act in this way, as a result." Such a faith endures; it has encompassed the heart as well as the head, and so it provokes corresponding action - part of which is to continue on despite sharp resistance.
Examples of this sort of belief, abound in non-religious life. If, for example, the label on a box of rat poison warns that consuming the contents of the box will kill me, and I believe the warning, I'm not going to consume the rat poison. Even if the rat poison smells delicious, or I was really, really hungry, or I saw a rat eat some of the poison and skitter off, apparently unharmed, if I truly believe the warning, my actions will reflect that belief and under no circumstances will I eat the poison, ever. In this belief, I will "endure to the end," never in my entire life even snacking experimentally on rat poison.
"Enduring to the end" is, then, the natural consequence of what's been called a "saving faith," a belief that anticipates and generates corresponding action. Just like with the rat poison warning, if I believe the Gospel, not merely in my head, but also in my heart, which is to say, if I anticipate that my belief in the Gospel will inevitably manifest in my living, it will naturally occur that I persist in that belief, even if doing so costs me greatly.
Jesus, in the verse above was not, then, encouraging his disciples to "dig deep" and force themselves to keep going in the face of terrible persecution but to believe, really believe, the truth of the things they were not only being told but would be sharing with others. This is the message of Hebrews 11. We all walk by faith, not by force of will, or grit, or stubbornness (2 Corinthians 5:7; Romans 1:17; Galatians 3:11; Hebrews 10:38). Our faith is grounded in the truth of Scripture and the reality of its supernatural Author, strengthened by a daily experience of God at work in us by the Holy Spirit convicting, teaching, strengthening, comforting, and transforming us, and refined in the crucible of testing and trial. Such faith, then, is not reliant upon the force of human will, upon one's ability to "tough it out," but is created, supported and enlarged by God Himself. And this is reflected in an enduring faith.
This view of faith and enduring to the end avoids the unavoidable "two Saviors" problem of salvation by works, properly synthesizing the necessity of faith to Christian living with verses that locate salvation solely in Christ.
23 When they persecute you in one town, flee to the next, for truly, I say to you, you will not have gone through all the towns of Israel before the Son of Man comes.
24 “A disciple is not above his teacher, nor a servant above his master.
25 It is enough for the disciple to be like his teacher, and the servant like his master. If they have called the master of the house Beelzebul, how much more will they malign those of his household.
Jesus warned his disciples here that they would encounter the same resistance their Master had encountered. Their faith, then, could not be a shallow, intellectual thing, but would have to be equal to the persecution that would befall them, deeply anchored in their personal knowledge of himself.
Matthew 10:26-33
26 “So have no fear of them, for nothing is covered that will not be revealed, or hidden that will not be known.
27 What I tell you in the dark, say in the light, and what you hear whispered, proclaim on the housetops.
28 And do not fear those who kill the body but cannot kill the soul. Rather fear him who can destroy both soul and body in hell.
29 Are not two sparrows sold for a penny? And not one of them will fall to the ground apart from your Father.
30 But even the hairs of your head are all numbered.
31 Fear not, therefore; you are of more value than many sparrows.
32 So everyone who acknowledges me before men, I also will acknowledge before my Father who is in heaven,
33 but whoever denies me before men, I also will deny before my Father who is in heaven.
Again, the Gospel is not in view here; the message of the Twelve as they went out from Christ for a time was not salvation in him, but only that the "kingdom of heaven is at hand." They would "acknowledge Christ" though not as Savior in the Gospel sense, but as the Messiah promised to Israel whom they believed would be a Conqueror-King, not a sin-bearing, sacrificial Lamb. In any event, the Twelve would have their faith in Christ tested sharply, but they would, in such testing, discover the truth about their trust in him. In an effort to encourage them to endure in this testing, Jesus warned them of the consequence of denying him and of the danger of failing to "fear Him who can destroy both soul and body in hell." This was a very Old Covenant approach Jesus took in advising his disciples, but one with which his disciples would be very familiar and thus find provocative.
The born-again believer under the New Covenant is motivated very differently:
1 John 4:16-19
16 So we have come to know and to believe the love that God has for us. God is love, and whoever abides in love abides in God, and God abides in him.
17 By this is love perfected with us, so that we may have confidence for the day of judgment, because as he is so also are we in this world.
18 There is no fear in love, but perfect love casts out fear. For fear has to do with punishment, and whoever fears has not been perfected in love.
19 We love because he first loved us.
Matthew 22:35-38
35 And one of them, a lawyer, asked him a question to test him.
36 “Teacher, which is the great commandment in the Law?”
37 And he said to him, “You shall love the Lord your God with all your heart and with all your soul and with all your mind.
38 This is the great and first commandment.
Hebrews 4:16
16 Let us therefore come boldly unto the throne of grace, that we may obtain mercy, and find grace to help in time of need.