Most personal-safety advice is about what to do when something is already going wrong. The useful part is earlier: noticing a situation while it is still a choice. Score a journey you are about to make, work out whether you are being followed, learn what actually de-escalates a confrontation, and keep a log of anything that has happened to you.
This is not self-defence training, and no amount of planning makes an assault your fault. Attackers choose targets, and the things that make someone a less appealing target are mostly boring and unglamorous: looking like you know where you are going, not being absorbed in a screen, and being somewhere with other people. Those are worth doing precisely because they are cheap.
The other thing worth saying: if you are being threatened, robbed or harassed, comply and leave. Property is replaceable. Getting away safely is a win, not a defeat, and it is what every police force will tell you.
If you are being controlled, threatened or hurt by someone you live with or have a relationship with, that is a crime and there are people whose whole job is to help you leave safely. The National Domestic Abuse Helpline in the UK is 0800 2000 247, free and open 24 hours. Men's Advice Line is 0808 801 0327. In an emergency, always 999.