Destroy target black or red creature that's attacking or blocking. You gain 2 life.
However, if the creature becomes an illegal target before Surge of Righteousness resolves, it won’t resolve and none of its effects will happen. You won’t gain life.
If Surge of Righteousness resolves but the creature isn’t destroyed (perhaps because it regenerated or it has indestructible), you’ll still gain 2 life.