No matter how old you are, you need to discuss death with your parents, your children (when they are older), your significant others, and any other family you feel you might be involved when you die or they die.
There are a huge number of considerations, so I suggest you use a comprehensive site to help you http://www.gyst.com/ which is now https://www.joincake.com/thegooddeath/. I have also been recommended https://www.everplans.com/
To learn more about death in general, and some great tips about funerals - http://www.orderofthegooddeath.com/
Write down your laptop/computer password and/or PIN
Write down your phone password and/or PIN and/or design
Write down your password manager password AND setup a recovery contact if that is a feature it has.
Don't have a password manager? Get one, NOW, even if it is a password book (physical book)
If you use a MFA key, setup a backup MFA key and tape that to that paper
Document all the important contact(s) in your life - name, relation, phone number, email
Bonus: Include your CPA and/or Accountant.
Bonus: During taxes each year list ALL accounts you have (for example, 1 checking account at TD Bank)
Place all of the above in an envelope, seal it, sign the seal if you are paranoid, and inform at least 2 important people where it is
Update every 6-12 months, at least every Jan 1 minimum
Have a will, a legal will, this varies country by country (and within countries by state and/or province etc)
Have a medial power of attorney/Advanced Directive for Healthcare or your state's equivalent
Service or not?
Specific religious service?
Gathering after the service?
Open casket or not?
Cremation or burial?
Do you want a green burial that is better for the environment? (See order of the good death for more information.)
Organ donor?
Donate body to science?
Read below about digital asset management after death.
Whatever matters to you, make it known. It's uncomfortable but it will make the lives of those you leave behind simpler and will make sure you get what you want. Or in the cases of your family it will make dealing with their death less stressful - which is important when it will already be such a stressful event on its own.
If possible have some small life insurance to cover death related expenses. Funerals are not cheap.
Setup TOD (transfer on death) or POD (payable on death) if in USA, if not in the USA look into how to make your accounts accessible to who you want them to be accessible to, most accounts get frozen when you die.
Setup beneficiaries where possible on accounts such as retirement etc.
When you die you leave behind a lot of digital assets, as well as things that can/need to be accessed digitally. Please consider this.
I use a password manager, LastPass which has an emergency contact configured: https://lastpass.com/support.php?cmd=showfaq&id=9972 so someone can access every password they need to. You should have a spare hardware key and/or master password in a location the executor can find it, consider also your password for your phone and/or laptop.
Some domain registrars allow multiple contacts to control domain(s) like gandi.net - consider this for domains you own which are for more than your own purposes (do you own and manage domains for organizations? charities? non-profits? etc?)
Did you know google you can configure what to happen if your account goes idle? It's google inactive account manager. It lets you say what should occur. set this up now. They will send regular reminders of your settings. https://support.google.com/accounts/answer/3036546?hl=en
You may also want to consider telling the will executor handling your social media accounts what not to tell family. My family knows I have fetlife, other peoples do not. Sadly fetlife at this time does not gracefully or easily handle dead people you have to email them and then they will lock or delete the account. Facebook on the other hand handles death pretty easily and can memorialize the account or delete it.
Wired "Swedish Death Cleaning, but for Your Digital Life"
Visit your friends, your family, or at least email them or call them, you never know when they will be gone, don't regret it.
Tell people you love that you love them.
Tell people who have impacted your life, your career, etc, what impact they had - you never know when they will be gone or you will be gone and it is important for people to know the impact they have had on the world.
Please read about the the mission of the Death with Dignity National Center - support them if you can. All states should have rules that allow anyone who wants to die, no it doesn't kill people it's a choice. I know I would choose not to suffer.
https://www.deathwithdignity.org/
Look into "Body Disposition Form" within the US https://funerals.org/?consumers=legal-right-make-decisions-funeral - If you want an example of why there are examples such as the case of Jennifer Gable, who died as a transgender woman but was buried as a man by her family. https://www.funeralwise.com/digital-dying/10048/
If you don't have a body disposition form or something similar for your country or a friendly executor who knows your wishes and can speak up there could be issues as (you may be able to hire a private executor like a legally firm, or use the state) your next of kin will get to decide. If you have unsupportive family members (because of your identity or who you love) who may exclude your chosen family or deadname you or use incorrect (gendered) ceremony for you - do what you can to have a will and prevent them from doing this! (I.e. if you are unable to legally marry your partner, you unsupportive parents get to decide what happens to you, even if you have no stuff!)
If you or a loved one is notable or known outside the family, there may be pressure from a group to know details of the death or how to grieve the death.
Try and plan, in advance, Who will post what where and how (online and off).
I.e. Will someone have access to all of their accounts and they can post a blog post that will be updated as needed and can point everyone there.
Can you afford to use an external PR agency to prevent the family from needing to deal at all?
How much detail should it include?
Can recommendations for the outpouring of death be given to direct the energy (foundation, scholarship, trust, favorite charity?)
Will there be a community public memorial online or off non close family can participate in? is there a friend of the family that is in that group that can organize that?
Educate as needed family on locking down their accounts and how to best respond to trolls. Prepare them for the mess that might happen.
So if all this is so important to me what are my choices?
I have a will
I have a DNR (Do Not Resuscitate) with my MPOA (Medical Power of Attorney)
I want organs donated and body to science.
I do not want to be embalmed.
I do not want a viewing / service, so casket moot point
I want to be turned to dirt https://returnhome.com/ , if not possible I want to be cremated (whatever is not donated).
Have a memorial service if it makes you living feel better. Ideally have it with food if possible. No flowers please, donate to something like Planned Parenthood or Doctors without Borders or the Trevor Project.
I want all my online accounts purged/deleted as soon as possible (after data needed for taxes etc taken care of) so likely 3 years after?
I have a password manager, 1password, and am working to have significant other have access.
I have google auto destroy account enabled on my accounts after 12 months inactivity, so keep them active during probate.
Advance Directive for Healthcare (http://www.vsb.org/site/public/healthcare-decisions-day) is what you want to have in place to designate an agent in the event you're unable to make decisions yourself and also to describe what powers that agent has and, if you wish, how you expect that agent to handle things. It's a nice standard form in fairly simple language and it indicates the needed signatures, etc.
An advance directive can also be registered in a database in VA, so it's accessible as necessary. https://www.virginiaregistry.org/
The state bar also has a page quickly explaining last wills. http://www.vsb.org/site/publications/wills-in-virginia/
I am currently 47 years old. Unfortunately in that time frame I have lost a lot of family members. Some (most) were accidents, some to age, some to cancer, and one to suicide. That’s 11 deaths total. Only 1 person out of 11 had a will.
When you are grieving the last thing you want to do is close an estate up.
It’s even harder if nothing has been prepared in advance.
After the initial shock of the death settles (the phase where everyone is usually nice), greed comes through in a most alarming manner. I’ve watched people turn into monsters. Make sure you have a will!!!! or people will fight. 
I know most people hate thinking about their death or their spouses death but honestly it’s just a fact of life.
I’ve personally been the executor of 2 estates now.
This is my advice:
1. If your young get life insurance. If you’re retired it’s not worth it.
2. Make sure you have a will.
3. Make sure you have a personal directive.
4. Make sure you have a power of attorney set up.
5. If your married make your spouse the beneficiary of your TFSA and RRSP(has to be done through the account not the will), they will roll into the spouses account without taxation.
6. If you’re married, and you own a house, make sure both names are on the title, joint tenant, NOT tenant in common. This activates right of survivorship on property and doesn’t have to go through the estate.
7. If you’re married, both people should have their name on all the vehicles, joint, otherwise it’s a headache after death.
8. Buy a file folding system. I have a plastic one that has a clasp and handle.
9. Put EVERYTHING in this file folder that would be needed if you died tomorrow.
a) all land titles
B) information on house insurance so it can either be eventually canceled or name changed over.
C) your will (or the location of your will),  power of attorney, and personal directive
D) the information for your car, car insurance, and registration on vehicles.
E) information on life insurance.
F) all current year papers needed for filing your taxes. Because the survivor will have to do it and will need that information.
G) where your household bills are. ALL OF THEM, electricity, gas, Netflix, magazine, subscriptions everything you can think of that is in their name. Because you are going to have to cancel them.
H) their credit card information where to contact to cancel the cards
I) birth certificate, SIN numbers, marriage, license, etc.
J) information on all your investments accounts, bank accounts, etc.
K) anything else you can think of for your situation
If you’re married, I’d have one box per person.
When you die, the funeral home will issue many death certificates. And your lawyer will give you copies of the will.
These will be needed to change over any accounts. Everything else goes through the estate which is taxed and the lawyers take their fees so I’d avoid this as much as possible especially if you’re married. This is why having property in both people‘s names is so important because it doesn’t have to go through probate.
I am widowed now and I have my black file folder and my two remaining children know if something happens to me, all they have to do is grab the folder. Everything they need to take care of my estate will be located in this folder.
At the beginning of every year, I open this file up and go through everything to make sure it’s up-to-date.
If you are young and do not own much or can’t afford a will, you can draft one up but it must be handwritten to be classified as a legal document. You cannot type it out!! If you’re not worth much, everything will most likely be sold to pay your bills and cover your funeral expenses. But you can state who your executor will be in your handwritten will.
 Disclaimer I’m not a lawyer or an accountant and this is not legal advice. Talk to a lawyer and talk to an accountant. Make sure everything is set up for you and your situation. These are situations that I personally ran into.
Good luck
Also I’ll add in. IF you have a lot of assets make an appointment with your accountant first. They will tell you how to properly set things up. Then take that information to your lawyer.
https://github.com/potatoqualitee/eol-dr End-of-life Disaster Response
http://www.gyst.com/ now https://www.joincake.com/thegooddeath/
and please watch this - https://www.youtube.com/watch?v=PVgumSUZQRI
https://archive.org/details/Online_No_One_Knows_Youre_Dead Online, No One Knows You’re Dead by Andrew Kalat
The Big Book of Everything https://www.erikdewey.com/bigbook.htm
https://lifehacker.com/five-things-to-do-when-planning-for-your-digital-death-1826496843
https://lifehacker.com/you-need-to-deal-with-your-digital-legacy-right-now-1820407514
https://www.ionos.com/digitalguide/websites/digital-law/digital-legacy/
http://deadsocial.org/legacy-builder/digital-legacy-checklist
http://www.safebee.com/money/whos-charge-your-online-presence-after-death
In Case You Get Hit by a Bus: How to Organize Your Life Now for When You're Not Around Later by Abby Schneiderman, Adam Seifer, Gene Newman https://www.goodreads.com/book/show/49150976-in-case-you-get-hit-by-a-bus
Life, Death, and Splitting Secrets https://www.moserware.com/2011/11/life-death-and-splitting-secrets.html
https://youtu.be/hhniUz5xG24?t=6889 "Death, Dealing, and Digital Forensics"
Andrew Kalat at ShmooCon presentation in 2016 about the 'digital death' aspects. Even if some of the technical information has changed since his talk, the overall story and process was told in a really engaging way. Check out "Online No One Knows Youre Dead" https://www.youtube.com/watch?v=4GL10xrzyyU