Understanding My Mind

I feel like this may be an inappropriate thing to talk about and am not sure if this is the right outlet, but I did something terrible and I don’t fully understand why. I had an affair a year ago and I don’t really know why other than the fact that I was so overwhelmingly depressed. I had been so overwhelmed with being a mother. I had told my husband numerous times that I was unhappy and wanted to leave all the time and he didn’t seem to care. I didn’t want to hurt him I think I just wanted out. But now of course I miss my old life. What I really don’t understand is why I’m continuing to see the guy. My husband found out about the affair almost immediately and swiftly kicked me out of the house. My life is completely unrecognizable. Why did I do this? What is wrong with me? How do I get ahold of my life?