Remove both brake caliper bolts with a 5mm allen wrench.
Remove the caliper from the rotor.
Straighten the end of the retaining pin.
Remove the retaining pin.
Push the pads out the top of the caliper.
Push both pistons back into the caliper with the enclosed end of a 10mm wrench or similar tool. Take care not to crack the pistons.
Mount the new spring around one pad as shown below, then add the other pad making a sandwich.
Push the pads and spring into the caliper from the top until the hole in the pads lines up with the hole in the caliper.
Install the new retaining pin.
Bend the end of the retaining pin over so that it cannot come out.
Remount caliper on rotor and install both bolts loosely.
This video covers the alignment of the caliper and final tightening:
https://youtu.be/uk_nC9anQcM?si=g2C43Vh5bMKyZqLB&t=173
Now it's time to go for a ride to bed in the pads. In a safe area, get up to a good clip say 12-15 mph and apply the brake firmly, but do not lock it up. Do not stop all the way, but slow way down and get back up to speed. Repeat this process 10-20 times until your brake works well; you will feel it get stronger as pad material is deposited on the rotor.