In the Old Testament, "the Sword of the Lord" has to do with God's judgment: Judges 7:18-20; 1 Chronicles 21:12; Isaiah 34:6; and Jeremiah 12:12 speak of His might, and of His holding those who oppose Him, accountable. And even though He is called the "Prince of Peace," He has many issues with which to deal before He brings in everlasting peace (Isa. 9:6)! It will not be until all His enemies are defeated that true peace will come; John wrote: "And God shall wipe away all tears from their eyes; and there shall be no more death, neither sorrow, nor crying, neither shall there be any more pain: for the former things are passed away" (Rev. 21:4).
Yes, in the New Testament, His Word is compared to a sword, only sharper; "For the word of God is quick, and powerful, and sharper than any two edged sword, piercing even to the dividing asunder of soul and spirit, and of the joints and marrow, and is a discerner of the thoughts and intents of the heart" (Heb. 4:12). Jesus tells us "Think not that I am come to send peace on earth: I came not to send peace, but a sword. For I am come to set a man at variance against his father, and the daughter against her mother, and the daughter in law against her mother in law. And a man's foes shall be they of his own household" (Mt. 10:34-46).
Jesus intends to separate those who have placed their trust in Him, from those who never accepted His free offer of salvation. Those who believe with their hearts will be saved (Rom. 10:9-10), and those who are religious, those who are playing church with Jesus excluded from His rightful place in their lives (LORD), as those described as being in the Church of Laodicea, they will be cast into the Lake of Fire (Rev. 3:14-22; 20:14-15)!
The Word's words will either comfort you, or they will condemn you!