Dear Zara,
Wa alaikum assalam
The reference is to do with matters of religion. In other words, the insinuation is that one must not be drawn into their sectarian ways or their endless disputes.
Please kindly note verses 30:31-32 which similarly set the context, even for the prophet, to follow God alone and not to become of those who split up their religion and become parties. This is not a reference to total disassociation with other human beings simply on grounds of different theological views, especially if no harm is being committed to another.
It is important to remember that believers are encouraged to be peaceful with everyone regardless of their religious beliefs and that there is no compulsion in religion.
018:029
"And say: The truth is from your Lord, so let him who please believe, and let him who please disbelieve; surely We have prepared for the iniquitous a fire, the curtains of which shall encompass them about; and if they cry for water, they shall be given water like molten brass which will scald their faces; evil the drink and ill the resting-place"
109.001-6
"Say: O disbelievers! I worship not that which you worship. Nor will you worship that which I worship. And I shall not worship that which you worship. Nor will you worship that which I worship. To you your religion, and to me my religion"
I hope this helps, God willing
Joseph