It is a very good idea to create advance directives in order to plan for the possibility that you may one day be unable to make your own medical decisions. In doing so, there can be confusion about the difference between a living will and a "do-not-resuscitate" order (DNR). While both these documents are advance medical directives, they serve different purposes.
A living will is a document that you can use to give instructions regarding treatment if you become terminally ill or are in a persistent vegetative state and unable to communicate your instructions. The living will states under what conditions life-sustaining treatment should be terminated. If you would like to avoid life-sustaining treatment when it would be hopeless, you need a living will. A living will takes effect only when you are incapacitated and is not set in stone -- you can always revoke it at a later date if you wish to do so.
When drawing up a living will, you need to consider the various care options and what you would like done. You need to think about whether you want care to extend your life no matter what or only in certain circumstances. A living will can dictate when you want a ventilator, dialysis, tube feeding, blood transfusions, and other life- saving or life-prolonging options.
A DNR is a different document. A DNR says that if your heart stops or you stop breathing, medical professionals should not attempt to revive you. This is very different from a living will, which only goes into effect if you are in a vegetative state. Everyone can benefit from a living will, while DNRs are only for very elderly and/or frail patients for whom it wouldn't make sense to administer CPR.
In addition to a living will, you will also need a health care proxy or broader medical directive.