But for Bitcoin, I don't know how this can be done as it may require revealing the secrete codes of the wallets or storage device. Is there any other way this can be done?
If you want your heirs have access to your bitcoin after your death without you having to reveal your private keys (or seed phrase) when you are alive, you can follow the guide provided by LoyceV.
Using Locktime for inheritance planning, backups or gifts