You started this thread asking about friendships.
It turns out your wife and your cousin had a secret affair which resulted in birth of a child. Affair kept secret from both you and his spouse.
I don’t really know if you can make it right. I do however want to assure you that this is not a friendship issue. You have an unhappy marriage and your wife looks elsewhere.
Are you determined to stay married