Your BEST efforts will not be good enough to pull anyone out of the hole you've dug. You will only pull people into the hole, because YOU are already IN the hole.
This is going to require DEVINE intervention!
While I usually agree with tst and find his advice to be some of the very best on these boards, I disagree with this.
While it's true that your decisions and behaviors have gotten you into trouble in the past, it's also true that people can learn new skills and behaviors. I think it's quite possible for you to change and become the person you want to be. I think you can make conscious decisions and changes that will result in you looking at yourself in the mirror and being genuinely proud of who you are.
Regarding divine intervention, if you are religious then your church, bible study group, women's group, etc. can be a great help. I would avoid meeting with the preacher (if it is a man) one on one because you do not yet have good boundaries. You should not EVER talk about marital problems one-on-one with a male.
People end up in affairs because they fail to recognize all the tiny little steps that get them in "over their heads" and they fail to protect their marriage.
For example, a particular weakness of yours seems to be old love interests. In light of that you probably should decide to NEVER contact an old love interest. You should figure out now, ahead of time, how you'd react if you got an email, or phone call, or Facebook friend request from an old flame or even an old classmate that you've not seen in a long time.
I know that I have a tendency to praise and admire people, and if I express admiration to a male that can be dangerous. So I'm careful with admiration and compliments.
That's the kind of thing you need to be looking at when you figure out how you allowed yourself to get into two affairs.
Also think about who crossed "the line" first, and most often. If it was you, figure out how, and why, and fix it. If it was OM, figure out why you allowed it. Put a game plan in place so that in the future you are ready with a new plan of behavior.
One thing most waywards need to change is how they allow themselves to associate with members of the opposite sex. You might have boundaries that you never are in a room with one male; if your boss calls you into his office, you ask the admin assistant to come in as well. If you're invited to sit with a guy in the break room, you invite someone else to join you. You never give or accept a ride from a male if there are no others riding with you. Things like that.
You also need to allow your H to be your best friend. Sit down with him and brainstorm a list of activities that you both enjoy. Make sure you spend at least 15 hours per week engaged in those activities. That means without doing chores, or watching TV, or having the kids in tow. Just the two of you, focusing on each other and having fun.