Only you can look back and trace the wrong steps you've taken and the wrong decisions you've made that led to your present situation. And it might be good for you to do so; it might help you avoid them in the future. If we don't learn from our mistakes, we're doomed to repeat them in the future.
The real question, however, isn't how you got to this place in your life -- but where you ought to go from here. And the answer is clear: You need to put God at the center of your life instead of yourself. Your commitment to Jesus as a child may have been sincere, but apparently you never grew in your faith, and you ended up dismissing Him from your life. If you stay on this path, it will only mean further heartache and trouble. The Bible's command about this is clear: "Avoid it, do not travel on it; turn from it" (Proverbs 4:15).
But God still loves you, and Jesus Christ wants to forgive you and put you on the right path in life. You can't change the past, but you can change the future by giving your life to Jesus Christ and turning your future over to Him.
How can you do this? By a simple prayer of faith repent of your sins and ask Christ to come into your life. Then seek out a church where you can grow and be strengthened in your faith. God bless you.