The context above that verse is important. It's not that Christians shouldn't associate with non believers, but avoid believers "brothers and sisters" that are basically fake.
1 Corinthians 5:9-10 NIV
[9] I wrote to you in my letter not to associate with sexually immoral people— [10] not at all meaning the people of this world who are immoral, or the greedy and swindlers, or idolaters. In that case you would have to leave this world.
1 Corinthians 5:9-10 NIV [9] I wrote to you in my letter not to associate with sexually immoral people— [10] not at all meaning the people of this world who are immoral, or the greedy and swindlers, or idolaters. In that case you would have to leave this world.