Use Gmail's "Recovery Contacts" feature to regain access to your Google account during an emergency. All you need to do is reach out to a trusted contact.
You can use iCloud Keychain or iCloud Keychain to save your passwords and easily access them on your iPhone. Here's how to recover deleted passwords on your iPhone.