The context for this is that Jesus was telling his disciples about the consequences of spreading the Gospel: that they and any who followed them would be persecuted. That is, the implication is that his followers will be put to the sword, rather than living in peace; he's not encouraging them to use swords on other people.
He does, separately, assure them that terrible things will happen to people who were mean to them when he comes back, but that's not this verse, lol.