It is good that you believe that it is one of our duties to do our best to avoid that haraam free mixing. Let us tell you that we do not object to upholding family ties at all; rather we promoted and encourage that, because it is part of upholding the ties of kinship (silat al-rahm) that is enjoined upon us by Allah and His Messenger.
But more important than that, the questioner should understand that there is no contradiction between the two matters at all. It is possible to keep away from haraam free mixing and it is also possible to uphold ties of kinship. Islam enjoins both matters, so it is not possible for there to be any contradiction between them.
In that case, what you should do in your country is try to uphold the ties of kinship and avoid the free mixing that is widespread in your country. There are many people who have been able to do that and live their lives in a natural manner.
But it is important for the individual to have sufficient resolve and keenness to do that.
If when people visit you, you allocate one place for women to sit and another place for men, and you show your keenness to implement this segregation, then when you visit your relatives or other people, they may follow your wishes with regard to this segregation when they realize that you are very keen on that, no matter how small the house is.
With regard to chance meetings in the street and in the entry way to the house if it has only one entrance, and so on, this is something that is not forbidden in shareeah and the rulings on it are not strict; what is prescribed is to be cautious with regard to this matter so that it does not become the norm and a person should not do it if it is possible to avoid it.
Finally, you should note that attaining Paradise requires some effort, hard work and striving. Paradise is surrounded with difficult matters that people may find hard, but one needspatience in obeying his Lord, and that is the greatest kind of patience. The Messenger of Allah (blessings and peace of Allah be upon him) said: Knowledge is only attained by striving to learn and patience is only attained by striving to be patient and the one who seeks good will be given it and the one who seeks to avoid evil will be protected from it. Narrated by al-Tabaraani in al-Awsat, 2663; classed as hasan by al-Albaani.
See also the answer to question no. 12838
And Allah knows best.
Reproduced from Islam QA