How to apologize to my ex?

i am 17 year old. well i was in the relationship with my boyfriend was 4 months... we had 3 break ups. finally after the 3rd break up... he told me he wanted to break up bc of his and my mum happiness.. which i found truly appreciable... but i was not able to move on.. so he said he would ask his bestiee to talk with me as a counsellor.. i poured down my heart to his bestiee ( a girl ) .. i told one private information about me and him... bc i was confused about it... i told her he wanted to have sex... in order to create unbreakable bond.. i was confused about it... she got pissed off and asked my boyfriend... my boyfriend abused me like hell.. literally told me to die.. his bestie stood up for me.. in the end the break up was supposed to a mutual partition ended in horrible one.

first of all.. did i took bad step by telling such private info... if yes please help to ask an apology from my ex.. ?
How to apologize to my ex?
Add Opinion