The Catechism in Questions & Answers

338. Is euthanasia a violation of the Fifth Commandment?

Anyone who provides active euthanasia— that is, who performs actions that lead to the death of a dying person— violates the Fifth Commandment.
Passive euthanasia—that is, the decision not to take any measures to prolong life—is not considered a violation of the Fifth Commandment, provided certain strict conditions are met. The decision to abstain from taking any measures to prolong life is first and foremost up to the patient himself. In the event there is no advance medical directive, this decision should be made solely in consultation with doctors and relatives after a responsible assessment of the patient’s best interests.