Galatians 5:10
“I am trusting the Lord to keep you from believing false teachings. God will judge that person, whoever he is, who has been confusing you.”
It's a sad fact, but there are those who are on the wrong path that are a corruptive influence. I think of college professors who know they are influencing young people contrary to their upbringing. They think they are helping, but if they are teaching them contrary to God's Way, then it's bad.
Are we to avoid nonbelievers? It depends. Jesus associated with sinners, but they weren't His social circle. We will bump into those at work and in the neighborhood in which we are to be a good witness. But our primary group of friends should be christians.
Hebrews 10:24 tells us how we are to be towards our friends, "and let’s consider how to encourage one another in love and good deeds". We should be better due to the contact with our friends. They should be better as well.
What about those in the church who don't seem to prioritize their faith? Paul addresses that in I Corinthians to avoid some by saying this, "I did not at all mean with the sexually immoral people of this world, or with the greedy and swindlers, or with idolaters, for then you would have to leave the world." He was saying to avoid those acting this way who claim to be believers.
Those Holy Spirit also guides our friendships. He opens the doors to be with some and closes the door with others. We do our best where we are planted. Be faithful with the few and He will bless us.
We shouldn't choose friends based on status or for selfish reasons. That's the worlds recipe which bring them into ungodly places. Jesus didn't care what others thought. He did the right thing regardless of what those helped could do for Him.
The Lord says harsh things about those who corrupt His children. Jesus says in Luke 17:2, "It is better for him if a millstone is hung around his neck and he is thrown into the sea, than that he may cause one of these little ones to sin." We need to be careful that we don't do this.
As believers the Lord gives us freedom to do many things. However, not everyone has the same liberties. Romans 14:19-21 says, "So then we pursue the things which make for peace and the building up of one another. Do not tear down the work of God for the sake of food. All things indeed are clean, but they are evil for the person who eats and causes offense. It is good not to eat meat or to drink wine, or to do anything by which your brother or sister stumbles."
The Lord protects us. He will close doors to keep us from bad influences. As we grow He teaches us wisdom to choose who to associate with. Proverbs says much about friendships. Here are some tips, don't associate with those given to anger, braggarts, those who talk too much and so on. We are also to use those same instructions to be better ourselves.
Lord, thank You for protecting us. You've altered circumstances to do so. Thank You. Help us to be a good example to others.