To avoid confrontations, avoid placing yourself in locations or situations were violence is likely and do not make yourself an attractive target to any would be attackers. Keep valuables out of sight, park your car in well lighted areas, avoid isolated places, travel with the car doors locked, avoid suspicious looking people and situations, do not consume too much alcohol, walk towards oncoming traffic, keep away from aggressive individuals or groups, do not stop to talk to strangers etc. Be aware of your surroundings and, should an undesirable situation start to develop, you may be able to avoid it all together, and, if you cannot avoid it, then at least the element of surprise is lost to your assailant.
If the opportunity for ambush is lost to opponents, they will have to attempt a direct attack. Directly approaching a person takes more courage, since there is a greater risk of losing the confrontation. This may cause the assailant to abort the attack and find an easier victim later. Assailants who approach you directly may appear to be very friendly at first in an attempt to take you by surprise. They may ask for directions, a light, or the time in a friendly manner in the hope that you will drop your defenses and allow them to get closer. When close enough, they will then launch their assault, either verbal or physical.
It is common for assailants to begin their attacks with a barrage of swearing and verbal abuse. They may wish to frighten you to get you to comply with their requests, or they may simply be looking for a fight. It may also be that the person is not sure of their ability to beat you, so they are using the verbal attack to "feel you out" to help them to determine the risk of engaging in a fight.