Since the release of Android 6 apps have the ability to back up data to a Google account. I don't know if all apps make use of this feature, but many of the important ones I use do. Just signing in to the right Google account will pose the question of if you want to restore data from a different device or not.
There's also a backup mechanism built into ADB. This is a manual process that puts a copy of all apps and information (but probably not security keys) on your computer, optionally encrypted with a PASSWORD. Google deprecated this functionality though. See here for a short guide: https://9to5google.com/2017/11/04/how-to-backup-restore-andr...
There's always TWRP/Titanium Backup if you have root access, or in the worst case scenario, starting a root shell over ADB in recovery mode and just DD-ing the entire data partition to a file in your computer.
There's also a backup mechanism built into ADB. This is a manual process that puts a copy of all apps and information (but probably not security keys) on your computer, optionally encrypted with a PASSWORD. Google deprecated this functionality though. See here for a short guide: https://9to5google.com/2017/11/04/how-to-backup-restore-andr...
There's always TWRP/Titanium Backup if you have root access, or in the worst case scenario, starting a root shell over ADB in recovery mode and just DD-ing the entire data partition to a file in your computer.