That's commonly called a double action strut.
That's the part that the sear pushes on to move the hammer back when the trigger is pulled in double action.
To replace, drive out the pin that holds the strut in place, BUT only just as far as necessary to allow you to remove the strut.
By not driving the pin all the way out, it makes it easier to get everything back together.
If it's already out, gently tap the pin in just until it stays in place.
Insert the spring into the pocket in the hammer, OR in the rear of the strut.
Install the strut into the hammer, and hold everything together while you tap the pin back in.
Alternative method:
Make up a "slave pin". This is just a short section of drill rod with the ends slightly tapered that will easily slide into the hole in the hammer.
Insert the spring and the strut, then slide the slave pin in to hold everything.
Then lay the hammer on a bench block with a hole to clear the slave pin.
Carefully tap the pin in until it pushes the slave pin out.