Before getting into defending yourself during an attack we can look into preventing one. Be aware, looking around and taking a mental notes of who is around you as well can allow you to not fall victim of being caught off guard. Do not flex wealth. Showing off or wearing expensive jewelry, bags, or clothes will certainly catch some eyes, not all welcome. Be sure to carry keys in your hand before reaching your car. This prevents distraction and allows for possible protection if you have to. I would like to note that in an instance of self defense. DO NOT punch, the bones in your hand if unconditioned are easily breakable. If you make contact be sure to use the heel of your palm. This allows for more dynamic movement and force in your blows. Making a fist and taking a swing also telegraphs your movement overall allowing for the attacker, if they are aware, to respond. If you do not believe me, feel free to try this out with a punching bag.
Due to gun laws being prevalent in most states and knives not being allowed restricted areas like federal buildings or bars. While fending off an attacker with a pen is not preferred or practical in most situations however they can and will pull double duty as a self defense weapon in a pinch if you are carrying it on your person when the time comes to need it. After all, nothing stops an attacker quite like being impaled by a chunk of plastic, titanium, steel, or aluminum.
In the instance where you need to defend yourself look aggressive, like most animals, humans also respond to posture. An intimidating animal will tend to ward off predators. Look for opportunities to strike weak points. Taking a low posture allows for responsive movement to take advantage of openings. When an opportunity arrives strike fast and hard. Strike repeatedly until unable. Aggressive fighting styles reward by giving no time to an attacker.
This should you win you a couple street fights if necessary.