Oh Jamiez, I'm so sorry you have found yourself here, the place where no one wants to be. There will be others after me with more experience to talk to you, but I just read your post, and want to reach out to you.
Firstly, wow, you have been through a LOT the past few years. No wonder you have become depressed, and you are stating all the classic signs of true clinical depression. Lots of reasons for you to be there, but please talk to your doctor about it and get some help. It's a terrible place to be, and the sooner you can start leaving there, the better off you'll be.
Secondly, YOU ARE IN NO WAY RESPONSIBLE in any way, shape or form for his decision to cheat. That is 100% on HIM. It doesn't matter what you've done to have some problems with your relationship, no matter how bad things get, he has many other options available to him besides stepping out of the relationship. (Not sure if you're bf/gf or married.) Stop blaming yourself - right now!
Feeling betrayed and hurt is totally normal. Of course you will feel that way. You've been unhappy too, but you didn't choose another man to help you solve your problems. You've just been betrayed by the man you love. Betrayal and hurt is the tip of the iceberg.
Read the information in the healing library and the BS (betrayed spouse) FAQ's. Lots of really good advice and help in there.
You may feel like you "dropped the ball" in the relationship, but you've been going through hell it sounds like. That doesn't excuse or justify what he did.
You say you still trust him, but then you say he needs to earn your trust back. IMHO the latter applies. You'd be a saint if you trusted him the day after you found out. He DOES need to earn your trust back, and you need to set some ground rules and boundaries right away to set him on that track.
Gently, don't be 100% sure this was the only time. It usually isn't. Do some snooping if you can, and talk to him. Don't let him start off with lying or trickle truthing (tt). That's what happened with me, my WH lied during his confession, and 15 months later he's still lying - because I allowed it from day one (inadvertently, but I allowed it nonetheless).
I'm pretty new here myself, not entirely comfortable with giving advice, and as I said, more will follow me with more advice.
I'm sorry for your pain, and all you've been through the past 3 years. You shouldn't have to deal with this on top of everything else. But you came to the right place. Keep posting, we've all been there, and we all want to help.
(((and strength)))