I don't know why you went down that road (as you put it)–but I do know that it didn't bring you the happiness you were seeking. And this is almost always the case with any illicit affair; it leads to disappointment and insecurity.
In fact, I can't recall anyone ever writing me about an illicit affair who said they were glad they had engaged in it, and that it had brought them lasting peace and happiness. At first, it may have seemed exciting–but then it turned sour, or it led to conflict and the breakup of their family. The Bible warns, "Can a man scoop fire into his lap without his clothes being burned? ... So is he who sleeps with another man's wife; no one who touches her will go unpunished" (Proverbs 6:27, 29).
The most important thing I can urge you to do is to turn to Jesus Christ and give your life to Him. You will never know lasting peace and happiness as long as you ignore God, because He made you, and He loves you and knows what is best for you. Confess your sins to Him and open your heart to Christ today.
Then ask God to help you strengthen your present marriage. You cannot change the past–but with God's help you can change the future. Put Christ at the center of your marriage, and then get into a church where you and your wife will grow closer to Him–and to each other.