You quote John's second letter. He is referring to those who come to teach or preach a different gospel than what he had preached...just as Paul had said to the Galatians in Gal 1. Let him be accursed--ie, cut off...anathema.
So what had John preached as his gospel? We read it in all 5 chapters of 1 John. Now just what John preached and taught is explained differently by everyone today. Good luck to you if you want to shun those who you think preach or believe differently than what John preached.
Then you quote Jesus, when He spoke to his disciples about going out to preach the Kingdom message. It works both ways what Jesus said. If people don't receive your message then go somewhere else, some place where they do receive. No use preaching to those who have shut their hearts to Jesus, unless you have his "now" word on it. Go somewhere where the people are more receptive. That 's what Paul did.
Acts 28:25-28 and also
Act 22:21 Then He said to me, 'Depart, for I will send you far from here to the Gentiles.' "
Act 22:22 And they listened to him until this word, and then they raised their voices and said, "Away with such a fellow from the earth, for he is not fit to live!"
Why cast your pearl's before swine, they will only trample upon them? So take your peace away from these people, dont share it with them...in that way, they stay in their chosen(but deceived)darkness. Then as the darkness has it's way in their lives, bringing them to the place of bondage and desperation,...then, maybe..there will be a chance to go to them with Jesus.
But as far as being friendly in a human sort of way goes...I live in Australia. In my town are mostly unbelievers, some Christians, many Catholics(who also are not filled with Jesus Spirit), some Muslims, some Hindus, some Bhuddists, some gays, athiests, etc etc. I make it my aim to be friendly to everybody.
Everyone needs respect. Everyone needs love and kindness. If they reject it, that's their problem.
1Co 10:32 Give no offense, either to the Jews or to the Greeks or to the church of God,
1Co 10:33 just as I also please all men in all things, not seeking my own profit, but the profit of many, that they may be saved.
If not being friendly to others offends them....then what? You have to work this out with the Lord Jesus inside of you brother.
If you are not being friendly because you are afraid of them in some way...or not being friendly because you despise them in some way....these are the issues God deals with in us. Personal thing hey?
Whether you realise it or not...Jesus lives in you and He loves all those people around you. But He does not force us to do anything. So work it out with Father God. Be yourself. If that means shunning others who reject Jesus....so be it. Go ahead and shun them. God will use all and bring you along the way as He always does.
You are a good brother.
Peace.