Answer: When it comes to non-mahram relatives like first cousins and in-laws, the first thing that we must be careful of is that however we uphold ties with them, we do not involve ourselves in fitnah (temptation) or in something that might lead us to haram.
Allah, the Almighty said:
"Do not come close to zina (fornication). Indeed, it is ever an immorality and is evil as a way." (Quran 17:32)
There is no doubt that anything that leads to haram is in itself haram. You don’t put yourself into a trial or a tribulation where you become a trial for them, or they become a trial for you.
Having said that, those who are from your relatives and those that are related through marriage—there is no harm in speaking to them when there is a need.
There is no harm in giving salaam to them when there is no fitnah in that, and when there is no trial in it. There is no harm in being there for them when there is a need for that, such as financially, giving gifts, or other forms of support. There is no harm in those things as long as you are not starting down a road that leads to haram, and as long as you are not a fitnah for them, nor are they a fitnah for you.
Many family members might find that difficult to understand, and I think the important way to explain it is to explain it in the context of respect. That’s because of the immense respect I have for them, the immense care that I have for them, and because of the rights they have over me. I would never want to abuse those rights, and I would never want to mistreat them in a way that the Prophet ﷺ forbade me to behave. I wouldn’t want to behave like that.
So, out of respect for them, I want to keep a little distance, but I want them to know that I’m there for them when they need it. I will do my very best to support them in whatever I can, and I will do my very best to fulfill the responsibilities that I have towards them. But I won’t freely mix with them or interact with them because that would be disobeying the Prophet ﷺ, and it would also be disrespectful to them as well.
Is it haram to take photos with non-mahram relatives?
I would certainly discourage it. I would never encourage you to take photos with them because we are commanded to lower our gaze.
Standing together in a photograph, one of us has got to look at the other one, right? So, it seems to me that that is something which is not appropriate for a Muslim to be involved in.
And Allah, the Almighty knows best.
— Answered by Ustadh Muhammad Tim Humble