In the Name of Allah, the Most Gracious, the Most Merciful.
As-salāmu ‘alaykum wa-rahmatullāhi wa-barakātuh.
Shariah permits nikah (marriage) between cousins. Therefore, it is incorrect for mature cousins of opposite gender to be socializing freely and without hijab.
Explain to your friend the wisdom of the laws of Allah Ta’ala in maintaining hijab and lowering the gazes.
Intermingling of members of the opposite gender has many harms, one of which your friend is now experiencing. The intermingling lead her to be attracted to her cousin and now she has to deal with her feelings for him. That causes anxiety and pain. Hijab safeguards one from such negative consequences.
Advise your friend to make Taubah for the intermingling and adopt hijab. In time her feelings will be balanced. By continuously seeing her cousin, she will be adding salt to her wounds and harming herself.
If both families visit each other then you should emphasise that your friend avoid contact with her cousin. She along with the other female members of the group should confine themselves to a separate room from the males.
And Allah Ta’āla Knows Best
Mufti Saeed Ahmed Golaub
Islamic Solutions
Jamaica
{قُلْ لِلْمُؤْمِنِينَ يَغُضُّوا مِنْ أَبْصَارِهِمْ وَيَحْفَظُوا فُرُوجَهُمْ ذَلِكَ أَزْكَى لَهُمْ إِنَّ اللَّهَ خَبِيرٌ بِمَا يَصْنَعُونَ (30) وَقُلْ لِلْمُؤْمِنَاتِ يَغْضُضْنَ مِنْ أَبْصَارِهِنَّ وَيَحْفَظْنَ فُرُوجَهُنَّ وَلَا يُبْدِينَ زِينَتَهُنَّ إِلَّا مَا ظَهَرَ مِنْهَا وَلْيَضْرِبْنَ بِخُمُرِهِنَّ عَلَى جُيُوبِهِنَّ وَلَا يُبْدِينَ زِينَتَهُنَّ إِلَّا لِبُعُولَتِهِنَّ أَوْ آبَائِهِنَّ أَوْ آبَاءِ بُعُولَتِهِنَّ أَوْ أَبْنَائِهِنَّ أَوْ أَبْنَاءِ بُعُولَتِهِنَّ أَوْ إِخْوَانِهِنَّ أَوْ بَنِي إِخْوَانِهِنَّ أَوْ بَنِي أَخَوَاتِهِنَّ أَوْ نِسَائِهِنَّ أَوْ مَا مَلَكَتْ أَيْمَانُهُنَّ أَوِ التَّابِعِينَ غَيْرِ أُولِي الْإِرْبَةِ مِنَ الرِّجَالِ أَوِ الطِّفْلِ الَّذِينَ لَمْ يَظْهَرُوا عَلَى عَوْرَاتِ النِّسَاءِ وَلَا يَضْرِبْنَ بِأَرْجُلِهِنَّ لِيُعْلَمَ مَا يُخْفِينَ مِنْ زِينَتِهِنَّ وَتُوبُوا إِلَى اللَّهِ جَمِيعًا أَيُّهَ الْمُؤْمِنُونَ لَعَلَّكُمْ تُفْلِحُونَ (31)} [النور: 30، 31]