To solve this issue, Apple has begun a new contact legacy program allowing a person to designate up to five persons as legacy contacts. The individuals named are allowed to access the data and personal information stored in the iCloud upon death. The new program requires proof of death along with an access key. The designation is available in the iOS 15.2 update. You can find the new legacy contact designation in settings. For those using Google products, a system already exists for designating account access to other people. Facebook has also adopted a similar system.
I highly recommend that all individuals set up a legacy contact designation in order to avoid access problems on death, and to advise their contacts of the same.