From Protect your account with 2-Step Verification
Use backup codes
Important: Never give out your backup codes to anyone.
You can print or download a set of 8-digit backup codes to keep in a safe place. Backup codes are helpful if you lose your phone.
IMHO this is Problem X-Y
While it's some sort of common practice to share a Google/Gmail common account ...
I assume that you know how to install a bookmarklet. But jic, here are the instructions: https://support.mozilla.org/en-US/kb/bookmarklets-perform-common-web-page-tasks
Might not be someone hacking your phone. However they were mine. They gain access through your Gmail accounts and go through the back door of the web. I do not know all the computer lingo or terminology, but my case was proven. Once inside they can download and hide apps from Google play store or or even samsung galaxy. They are even appearing as my IP ...