You can also get a code from an authenticator app or your backup codes. Also,
I hope it will help you.
Hi Sipper, You can Log Out by following the below steps.
From Settings, swipe to and tap Accounts and backup.
Tap Accounts. Select your Samsung account from the list.
Tap Personal info, and then tap More options (the three vertical dots).
Tap Sign out, and then follow the on-screen prompts to log out of your account.