Over time. Decades.
I got involved in martial arts for a few years after I was attacked for no particular reason by people who were much older than me when I was a little kid, twice in short succession, and my parents felt that this was a good way to help with that kind of situation. I don't know if that was the best response that they could make but I don't disagree with it.
Army training happened later, in a just-post-9/11 world where I was feeling strongly patriotic and also looking a meaningful job. It had its ups and downs.
Concealed carry classes happened much later, after the incident with the 3 young men, wherein: Either the previous training didn't help, or I was doomed anyway, or both.
I remember everything up to the first hit very clearly. I'd seen these folks way over there doing whatever they were doing, but I didn't suspect any trouble in that little town. I just kept walking. Soon, I heard a set of footsteps right behind me -- at least one of them closed the gap quickly. Before I could formulate a plan (including "run"), I got hit hard and it gets murky. I do remember standing and facing all three of them under a street light and saying "What in the fuck do you think you're doing?" as a means of negotiation; this clearly did not work.
After that, I remember a blur of fast-walking back to my apartment. They were gone, like they'd never been there, but I was scared because I was sure that they were watching me go home anyway. I went around the back side of the building, deviating from my normal route home, watching my back as well as I could in that state.
I got home and I was satisfied that nobody had followed me as I re-locked my front door, and for a period of time (I don't know how long), I didn't think anything else happened. I forgot that I needed cigarettes. I eventually looked in the mirror and saw that it looked like I'd been hit by a car, and later noticed dirt all over my clothes. I called my ex-wife for advice, and then called the police who showed up and took a report (badly) and promised to do ~nothing else, and then called my boss for a ride to the hospital.
None of any of the training I've ever had really covered dealing with a surprise attack from three motherfuckers at once. It wasn't exactly ideal.
I still can't walk around in public with headphones on. I wasn't wearing them that night, but it was something that I occasionally enjoyed and that concept is subsequently dead to me.