A Living Will (formally an Advance Decision to Refuse Treatment) lets you state which life-sustaining treatments you refuse if you lose mental capacity. When properly made, it is legally binding on doctors under the Mental Capacity Act 2005.
Legal reference: Mental Capacity Act 2005 ss.24-26