From Pope St. John Paul II’s encyclical Veritatis Splendor (1993):
In the Old Testament we already find admirable witnesses of fidelity to the holy law of God even to the point of a voluntary acceptance of death. A prime example is the story of Susanna: in reply to the two unjust judges who threatened to have her condemned to death if she refused to yield to their sinful passion, she says: “I am hemmed in on every side. For if I do this thing, it is death for me; and if I do not, I shall not escape your hands. I choose not to do it and to fall into your hands, rather than to sin in the sight of the Lord!” (Dan 13:22-23). Susanna, preferring to “fall innocent” into the hands of the judges, bears witness not only to her faith and trust in God but also to her obedience to the truth and to the absoluteness of the moral order. By her readiness to die a martyr, she proclaims that it is not right to do what God’s law qualifies as evil in order to draw some good from it. Susanna chose for herself the “better part”: hers was a perfectly clear witness, without any compromise, to the truth about the good and to the God of Israel. By her acts, she revealed the holiness of God.
At the dawn of the New Testament, John the Baptist, unable to refrain from speaking of the law of the Lord and rejecting any compromise with evil, “gave his life in witness to truth and justice”,142 and thus also became the forerunner of the Messiah in the way he died (cf. Mk 6:17-29). “The one who came to bear witness to the light and who deserved to be called by that same light, which is Christ, a burning and shining lamp, was cast into the darkness of prison . . . The one to whom it was granted to baptize the Redeemer of the world was thus baptized in his own blood”.143
In the New Testament we find many examples of followers of Christ, beginning with the deacon Stephen (cf. Acts 6:8-7:60) and the Apostle James (cf. Acts 12:1-2), who died as martyrs in order to profess their faith and their love for Christ, unwilling to deny him. In this they followed the Lord Jesus who “made the good confession” (1 Tim 6:13) before Caiaphas and Pilate, confirming the truth of his message at the cost of his life. Countless other martyrs accepted persecution and death rather than perform the idolatrous act of burning incense before the statue of the Emperor (cf. Rev 13:7-10). They even refused to feign such worship, thereby giving an example of the duty to refrain from performing even a single concrete act contrary to God’s love and the witness of faith. Like Christ himself, they obediently trusted and handed over their lives to the Father, the one who could free them from death (cf. Heb 5:7).
The Church proposes the example of numerous Saints who bore witness to and defended moral truth even to the point of enduring martyrdom, or who preferred death to a single mortal sin. In raising them to the honour of the altars, the Church has canonized their witness and declared the truth of their judgment, according to which the love of God entails the obligation to respect his commandments, even in the most dire of circumstances, and the refusal to betray those commandments, even for the sake of saving one’s own life.
142 Roman Missal, Prayer for the Memorial of the Beheading of John the Baptist, Martyr, August 29.
143 Saint Bede the Venerable, Homeliarum Evangelii, Libri II, 23: Corpus Christianorum, Latin series 122, 556-557.
— Veritatis Splendor 91