Ex boyfriend harassing & mentally abusing me by msgs and other things

I am very tensed by the ex person who is just harassing me mentally abusing me following me on social media and contacting my frnds as well for threatening me .. Please help by advising me how I can make him stop torturing me like this using law will I have to pay for filing the case and what case he will be charged for what he did to me .. Even after being married and also having 2 kids he approached me for marriage and used me physically also that time made me alone did not let me speak to my frnds and others else abused me made a fake proposal to me using religious beliefs.. Then after 2 years he did run away without informing then made excuses and all kept relationship with me after sometime started fighting and made excuses to continue the relationship & did breakup then still threatend and msged me for publishing my pics on social media and following me he is still msging me and stalking me by using different accounts and numbers still mentally torturing me .. Please advice me what I must do without using my identity and keeping my family also unaware about this matter and case ..