Wow, that's a tough situation, and I really feel for you. I had a friend who went through something similar, and it was terrifying. The first thing she did was document everything—texts, calls, unexpected visits. Even if it feels excessive, having a record helps if you need legal protection. She also made sure her close friends knew what was going on, so they could check in and provide support.
Another thing that helped was changing up routines. Her ex knew her usual spots, so she started taking different routes home and avoided places he might expect her to be. It sounds exhausting, but it gave her a sense of control. Eventually, she got a restraining order, which was a huge relief. It’s not fair that anyone has to live like that, but safety comes first.