Since the coming into effect of the 1983 Code of Canon Law, this form of excommunication is no longer carried out.
Even the Code of 1917, now abrogated, stated this only applied for special cases in which the Apostolic See excommunicated him/her by name and has proclaimed the excommunication publicly and in the decree has stated expressly that he/she must be avoided. In other words, it was quite rare.
Of course, you relate in different ways towards someone under excommunication, bearing in mind the goal is to bring them back to Holy Mother Church, who loves them dearly and only as a medicinal remedy has excommunicated them for not repenting of a very, very grave sin. May your actions reflect that love, firm but charitable, that wishes them to walk with you on the way to heaven.
The same is true for non-Catholics, isn’t it? We want them to embrace the fullness of the Christian faith, experience the love of Christ, understand the danger of sin and evil and what remedies Christ and His Church gift us against them! May they see in us and in our faith something worth following!