Need advice

I have been harming myself in many ways for a long time now. I simple want to stop but no matter what happens I fail to stop and I find a way to keep going. My mom saw my scars and threatened to send me away instead of trying to talk to me. The only other person knows about me harming myself is my boyfriend but even then doesn’t like it when I harm myself. Don’t get me wrong I don’t either but it has became a habit where I cannot stop. I have cut myself, gave myself bruises, hitting my head on walls or myself, even to the point of overdosing. Maybe I should consider going to those mental hospitals but even then I don’t want to go. My boyfriend recently took away my pocket knife that I used to cut myself I haven’t done anything crazy yet but I just been having thoughts I’m not sure what I can do to stop it.