You don't have to hit anything with a hammer when removing the manual safety assembly.
I strongly recommend you find a gunsmith familiar with S&W TDA guns and let him slip it out. And do the replacement for you.
For educational & trivia purpose ... and to satisfy your curiosity ... I'll offer a couple of explanatory comments about part of the removal process ... (not as a "how to" explanation) ...
Once the firing pin has been pushed far forward and has been captured by the safety plunger in the forward position (and remains there during the process until you're ready to actually remove the firing pin) ... and the safety assembly has been pushed partway out of the slide ... the firing pin still has to be pushed a little bit further forward so it clears the inside of the manual safety and the assembly can be removed from the slide (typically a very thin pin punch is inserted inside the rear of the manual safety to do this (to push against the rear of the firing pin), and is removed as the assembly clears the rear of the firing pin - and the punch bottoms out against the slide - so the assembly can be fully pushed free of the slide.
The spot where the safety plunger captures and holds the firing pin isn't quite far enough forward to completely clear the inside of the manual safety assembly. That's why the extra forward push is needed at one point to completely clear the firing pin from the assembly. I knew one armorer who would use forceps to capture the firing pin outside the breech face, after the firing pin was pushed completely forward (farther than needed to be captured by the safety plunger). That let him just push the manual safety assembly out of the slide. I never adopted that practice because I didn't want to risk scratching the firing pin with steel forceps, and I acquired the knack of using the thin pin punch to finish the task as taught in the armorer class.
As the assembly clears the slide, though, the body plunger may decide to fly free (hence the safety glasses recommendation). I use a finger tip to capture the plunger as the safety assembly clears the left side of the slide at that point.
BTW, it's VERY, VERY important that the ambi safety lever plunger & its spring DO NOT get switched with the manual safety body plunger & its spring. Really.
There's some other minor tips & tricks that are involved with the whole process, but I'm not posting this as a "how to", but to give you an idea of how it's seldom wise to proceed with "working" on a gun unless you know what you're doing and have some experience. (I've seen some less experienced armorers who had been through classes, but just never acquired much in the way of "bench time", and who damaged, or almost damaged, parts trying to work on something when they'd forgotten much of what they'd originally been taught.)
Just out of curiosity, why do you feel you've worn out a firing pin spring? Are you experiencing excessive firing pin wipe? If it were me, I'd be more concerned about having replaced the recoil & mag springs every 5 years or 5,000 rounds (I did it a bit sooner in the compact 6906 when I carried a couple of them throughout my career, as well as in my 3913).
I was taught to replace a firing pin spring if it became so short that the tip of the firing pin extended past the spring when the spring was fully on the pin (outside the gun, holding it up), or the gun exhibited signs of a damaged/worn spring. I can't think of more than maybe a couple of firing pin springs I've seen actually damaged/broken, and can't think of any that exhibited signs of being "worn out" ... although I've seen more than my fair share of them gunked up because folks used excessive amounts of solvents and lubricants around the slide openings to the firing pin channel (front breech face hole, plungers on bottom of slide, bottom of the manual safety assembly and the rear of the firing pin).
Find yourself a gunsmith who knows his way around S&W TDA guns.