life advice

Hello everyone before I ask for advice I want to put a disclaimer that I acknowledge how stupid I was as a teenager. Okay, so when I was a teenager, I had a best friend who told me I was popular and everyone loved her. (Turns out she popular for the wrong reasons) She had guys dying to be her boyfriend. I was very insecure and never had any confidence in myself. She introduced me to one of her male friends and he told me how much he had fallen in love with me and asked me for nudes. I was 14 he was 17 I believe and he made me so happy that I sent them to him. He later stopped talking to me and ignored me I was so heartbroken. She introduced me to another friend and I fell for it again because I didn't want him to leave me and then I did it again in hopes of someone giving me love and affection. I have come to realization about how dumb I was back then. I just had my baby (I am 20 now) with my boyfriend of 4 years now. I keep thinking how I don't my daughter be like me and it's making me go crazy... I just hate myself for all the dumb things I did. I never want my daughter to be insecure like I was. Why do I keep making mysel feel bad I can't get over it someone help :/ I am also afraid of them ever getting out:/