Well, with no details, it seems like an easy answer. Just don't. Don't do it. But I don't know the details so am guessing it's not that easy for some reason. This is your sister's husband?
Wow, what a pickle you're in. you know it's wrong and i take it that's why you are looking to quit this guy.but most importantly, isn't it your job to be honest and inform whomsoever, the fact that their significant other is cheating? To do the right thing, you may have to out yourself. It's hard to do the right thing, but as the one being cheated on. Unless it was a one time only deal, i'd want to know so i could make other arrangements, or get therapy for my relationship etc. You've put yourself in a bad place, and i'm so sorry that you're there. People make mistakes. and are forgiven if they know it was a mistake, and they assure the person they've hurt, it will never happen again. What are you thinking? How do you think you should handle this? What sounds like the best solution to you?
In AA it's said that you should be honest with someone unless it hurts others more than it helps. It's up to you how you handle this. No one can tell you what to do, only what they would do and why. Are there children involved, by being honest would you be forfeiting a relationship with kids of the family? More info would help.
In what way is he your brother-in-law? I read it as his being your husband's brother, or possibly someone married to your husband's sister.
Are there kids? Is your marriage going to last or is it on the outs anyway? (That is, if you are married.) Same question about his marriage (if he is married).
How do you stop? Find a good therapist and figure out what is driving you to do this.
I would suggest you work out in your head why you are so lonely or unfulfilled that you find this particular guy this irresistible. You could do this with a therapist, but if you don't have access to one (or the money for one) you could do it yourself. The hard part is not so much figuring it out, but deciding what to do. (Sometimes the reason we don't figure it out is because we know what the problem is, but feel stuck in the status quo.)
How can You stop having an affair with Your Brother in Law ?? ?? !! !! OMGolly - Just Stop !! Having an affair is a CHOICE !! You CHOOSE to have an affair OR You choose not to !! 'IF' You don't want to have an affair, well then just Don't !! Don't be alone with Him - Ever Again !! Don't take Your clothes off - Ever Again !! Don't get in bed with Him - Ever Again !! You don't say if this is Your Sister's Husband or if this is Your Husband's Brother but if You decide to 'confess' realize that You are every bit as responsible and deserving of whatever the consequences will be as the Brother In Law is. This kind of betrayal is always devastating to the 'injured party' but there is an especial anguish when it involves Family Members. Many of us feel a Family Member should always be 'off limits'. This I know is true .
How? Just quit! This isn't exactly rocket science. Just stop doing it!