Very easy to throw accusations and to flame someone when you see the world in black and white. Thing is the world is rarely black and white and affairs happen, not just to women, I would take the same view if it were a man.
OP, firstly you did not "find yourself in an affair," you did choose the path you took. However it is likely that something in the marriage led you down the path of becoming closer to someone else. Only by recognising what it was that was missing in the marriage will you come anywhere near to being able to resolve things in the future, and that's assuming your husband is willing to give you a second chance.
But you also need to be honest with yourself and with him about whether you actually want to stay in your marriage. If you stay it should be because you realise that you love your husband and want your marriage to work, not because you feel you owe him a debt of gratitude or because you think it will be better for the kids.
In my case my husband had spent years isolating me from friends and family, making me doubt myself, convincing me that I was worthless and that nobody would want to be friends with me, He made it impossible for me to go back to work after I had DC, and eventually moved us hundreds of miles away from any support network to ensure that I had no friends nearby.
If I went out he had me followed. He installed key loggers on my computer, bugged the house, used to threaten to kill my animals, gaslighted me into thinking that he knew my every move, accused me of having sex with people because I was apparently having sex with them in my sleep so it must be happening in RL.
I met someone online through social media through a mutual interest and we started talking. Things developed quickly into an emotional affair although I was fairly oblivious TBH because I had spent so long being told that only he would ever love me that I didn't think it was possible. I realised that I was getting closer to this OM but I wasn't prepared for when he told me he had feelings for me, but he did.
Eventually we met up, just once, and slept together. I honestly believed that I was in love with him and him with me, and after we slept together I never had sex with my husband again, which was probably how things unravelled so quickly. Anyway I decided that regardless of what happened with OM I couldn't stay in my marriage any longer and so I told my husband that it was over. OM ended the affair not long afterwards and my husband would have taken me back at that point, but I knew by then that my life needed to change drastically, so I pressed on and ended the marriage anyway.
OM got back in touch a couple of weeks later, promised me the earth, that he loved me and wanted us to be together as soon as the divorce came through. I thought he was the one and couldn't live without him but he actually got together with someone else in the meantime even though he kept promising me the earth.
Eventually I met my now partner and at that point I told OM that we couldn't even be friends any more, I deleted his number, all his contact details, anything relating to him including emails, texts etc and I haven't spoken to him now for nearly five years.
In the beginning it's hard. You think you've lost the love of your life, not least because of what you've put on the line to be with them. But the truth is that you've lost the life you thought you had and have traded it for one you need to build again from scratch.
But the less you hear from that person the less you care. Time changes everything. I could bump into OM now in the street and it wouldn't do anything for me.
But I can say with absolute certainty that I would never, ever have another affair, because regardless of my marriage an affair is not the way to end things.
You need to ask yourself whether you want to make your marriage work, whether you love your DH and don't want to lose him, and if so then you need to go to counselling to work out the issues, both for yourself and within the marriage.
And for anyone who says that you and you alone need to put in the work, that's not true. OP and OP alone is responsible for having had the affair. But there are many factors in a marriage which lead to affairs happening, and if they are not addressed at the time the likelihood is that another affair will happen in the future or the marriage will end anyway.
But if you don't love your husband and don't want to work on your marriage then don't be afraid to walk away. Someone said to me not long after I split from my DH that it was a shame me and OM weren't together because at least the split would have had a reason then. I said that it did have a reason, that I was now free to be in a better place.