Here I'd take "sword" as separation and peace as "unity" and "agreement". Sometimes the people in your own family will oppose God and make your walk much more difficult. We are not supposed to drop the teachings of Jesus to agree with and coddle our own family, or anyone else. This will in turn cause opposition and persecution against Christians. Read a bit about Christians in the Middle East or maybe India, how some get tortured or killed by their own families even nowadays.Matthew 10:34 34 "Do not think that I have come to bring peace to the earth; I have not come to bring peace, but a sword. 35 For I have come to set a man against his father, and a daughter against her mother, and a daughter-in-law against her mother-in-law; 36 and one's foes will be members of one's own household. 37 Whoever loves father or mother more than me is not worthy of me; and whoever loves son or daughter more than me is not worthy of me; 38 and whoever does not take up the cross and follow me is not worthy of me."
Just as in this verse. The war is to be understood as "division" and "separation" from the world. Not as us trying to actively harm others.Luke 12:51-53 51 "Do you think that I have come to bring peace to the earth? No, I tell you, but rather division! 52 From now on five in one household will be divided, three against two and two against three; 53 they will be divided: father against son and son against father, mother against daughter and daughter against mother, mother-in-law against her daughter-in-law and daughter-in-law against mother-in-law."
So separating us from the world, is what Jesus is actually talking about. We are to be "a peculiar people" and to make a difference.
Jesus used "hard sayings" all the time. Packed it in a form, that would repulse the listeners, unless they looked for spiritual understanding of what was said. Like when people were repulsed with Him "how will this man give us his flesh and blood to eat???" And Jesus said, "For my flesh is meat indeed, and my blood is drink indeed." God already put the premise to abstain from eating blood and canibalism. Then it must mean, that Jesus was saying something else here, and He did.Luke 14:26 26 "Whoever comes to me and does not hate father and mother, wife and children, brothers and sisters, yes, and even life itself, cannot be my disciple.
God already put the premise before you, to love your neighbor. By the logic of the above, it also means, that Jesus is saying something else here.
This is not called contradiction, this is called paradox. It serves to confirm to you that you "figured it out" when your understanding is in complete harmony with the rest of the Bible. So it is actually a tool to help understanding. If it doesn't fit the rest of the Scriptures, then the understanding isn't correct.
The first thing that you should ALWAYS do is reading the full context, rather than individual verses.
If you do this, you will see that this is a part of a parable, where God called people to be His and do His work, yet they were too busy with their family business and other affairs in the world, and ignored God and went on with their lives. The context of the verse makes it clear, as some other members pointed out already, that God's business should be put first and foremost. We are put into the world, to toil and suffer. Don't you hate it? Don't we all prefer eternal life of joy? The context of hating family is probably preferring one's family to the truth of God, remember how Solomon's wives turned his heart away from God.