People tend to be distracted getting into and out of their cars. We are all guilty of it, even those of us who should know better. But since we do know better, these occasional occurrences should be rarities because the truth is, you are vulnerable in those moments--especially women. The predator knows to approach when you are thus distracted.
Be aware and be decisive. This means that when you make the decision to fight, there should be no half measures. Come to peace with this in advance so when faced with the situation you are more likely to act accordingly. The videos below show two very different outcomes. In the first, the woman is taken by surprise, but once she makes the decision to fight, she is all in. Judging by her actions, she has had some type of training. And it worked.
In the second video however, the outcome was different. Notice the body language of the two men. Situational awareness usually carries the day--until it doesn't. Then it becomes a matter of will and intent, and of course, knowing how and where to strike.