Advice, please. (No judgement)

My boyfriend and I have been in a relationship for a little over a year. I made the mistake of confiding in another guy about the issues I had with my boyfriend and it ended up turning into a text-affair if that makes sense. We flirted, sent nudes and said dirty things to each other. We never had the intentions of meeting up and actually doing anything. It was all over text. The guy knew I had a boyfriend and did not care.. I told him I couldn't hurt my boyfriend and I felt really guilty about it. He persisted so like an idiot I also kept up the flirtation when I should of stopped it. I know I fucked up bad..  My boyfriend found out and decided to forgive me but told me I was going to have to work hard to earn his trust and fix our relationship. How do I earn his trust again? I love him so much and would do anything at this point to prove my love for him. That it was a mistake and I promise to never do it again.