Know your enemy, know your surroundings. Lol I know this sounds like some Batman shit, but seriously.
Know where you're going, where you will be likely to end up, know who's probably going to be there, and then arm yourself accordingly (with knowledge, of course!). Always avoid a potential confrontation, or give yourself something to do so that you aren't able to engage with any problem individuals. Surround yourself with good people, friends, so that a physical altercation would require the other person to put themselves at an extreme disadvantage. Build social credit in other ways so that the problem individual realizes that attacking you (socially or physically) will result in a negative reaction towards them from others. Play off their weaknesses. It helps if their stupid, which they usually are. Most intelligent people won't put themselves at a disadvantage unless there is a clear power dynamic. This power dynamic can be controlled in most circumstances, such as in the workplace where there are clear mechanisms in place for reporting abuse.
The only real place that you put yourself at a disadvantage without it actually being in your control is k-12 school. Even in that environment, you still have options but it's harder. I can't really speak from experience to be honest because I didn't have any trouble with bullies throughout my time in k-12. I was always in the classes with the smart kids (not bragging), so that alone helped me build some social credit (you would think that it would have the opposite effect, apparently not at a good school in a high income area). One option, that I know of, is to join a group (sports is the best), both of my parents were athletes in really shitty schools growing up and being a part of the team helped them build social credit and gave them a network of, in some cases, powerful friends who they could rely on for support.
Bottom line, bullies are generally rats. They'll only come out to damage you when they know they have a clear advantage. You can avoid putting yourself in virtually any situation where you are at a clear disadvantage through carefully scouting the situation beforehand.