Ye adulterers and adulteresses, know ye not that the friendship of the world is enmity with God? whosoever therefore will be a
friend of the world is the enemy of God. - James 4:4
My take here is this verse is not addressing people who cheat on their spouses... it is telling people who are a friend of the world - they are cheating on God, as well as His enemy.
Thus the opposite is also true, those who are faithful to God are the enemy of the world. Anyone who is the enemy of the world is going to be persecuted. Ladyjojo said it very well.
Another Good Question