Provide your keys in a will. Could always do a multisig as well where the will only has one part of what you need to access the coins, so nobody can get it just by looking at the will, and your family members have other parts of the multisig but not enough to get the coins without the will so they can't access them until the will is presented.
Or provide a partial key in the will and your family already has the other part of the key so they just have to put them together when the person dies.
I believe you can also make a transaction so that after a certain amount of time they coins in the address, if they are still there, get transferred to another given address. You give your family this other address, of course then the coins would officially pass to them whenever that time is up, not at the person's death, so it could be before or after the death.
But I bet every year some bitcoin is lost to owners dying, and I'm sure this will continue in the future, as probably most people aren't setting up how they will transfer their bitcoin unless they are old or sick. For example if I died my family would have no access to my bitcoin (something my mom likes to bring up as a reason why I should give her my keys haha, in her scenario she would spend all my bitcoin on doctors and medical procedures if something happened to me so that I would wake up broke lol).