Pregnant and telling the dad I’m scared

So I found I was pregnant Jan 22nd and I went to the doctor and I was 7weeks and 4 days my next appointment is March 16th and I’ll be around 11 weeks and i wanna tell the father then I’m 20 years and and he’s 21 ‘my birthday is March 12th last year I was pregnant by my bf at that moment and it was on purpose and we ending up not working out and my guy best friend was always there for me no matter what I ended up having a miscarriage at 3 months and me and my ex never talked again it was very hard for me . Then me and my guy best friend started sleeping together and I ended up getting pregnant we slipped up and I took a plan b but it didn’t work I’m terrified to tell him and lose my closest friend and pretty much my only friend at the moment we talk pretty much everyday and hangout on the weekends I don’t know how he will react and I want to tell him but i just can’t do it in or person but if I do it over text he can never talk to me again like my

Ex he knows everything about my past experience and was upset about how my ex treated me when I was pregnant but still he said he doesn’t want children and we aren’t dating just strictly friends that occasionally sleep together I know it’s irresponsible but it already happened any advice or tips on what I should do or even say please I’m freaking out and need advice

This is what I’m gonna say bad idea ?im freaking out