Two possibilities depedng upon the goals and concerns about data.
For information about how to request access to a deceased family member's Apple accounts, and through this their equipment, click here --> How to request access to a deceased family member's Apple account - Apple Support
Apple can completely reset a device if a person can provide sufficient evidence of valid ownership. Do this online at: Activation Lock support request - https://al-support.apple.com/#/additional-support Apple says, "Proof of ownership documentation is required," but does not detail what currently constitutes proof. Prior to this new online service Apple typically required the original receipt issued by Apple or an Apple Authorized Reseller and documented provenance (so typically it would be the original owner who does this, or a descendant with legal proof of ownership).
Apple recommends you "Keep your receipt after you buy an Apple device" --> Keep your receipt after you buy an Apple device - Apple Support
Note that the lock removal service will result in a wiped device.