How to receive Apple ID TFA code if I logout of iPhone? I need to logout of my Apple ID on my iPhone.  I have Two-Factor Authentication (TFA) enabled, and according to Apple Support TFA can no-longer be disabled.


  Can I turn off two-factor authentication after I’ve turned it on?
  
  If you already use two-factor authentication, you can no longer turn
  it off. Certain features in the latest versions of iOS and macOS
  require this extra level of security, which is designed to protect
  your information. If you recently updated your account, however, you
  can unenroll for a period of two weeks. Just open your enrollment
  confirmation email and click the link to return to your previous
  security settings. Keep in mind, this makes your account less secure
  and means that you can't use features that require a higher level of
  security.


So if I logout on my iPhone, and want to log back in, how can I receive the TFA code to authorise the login?
You have multiple options:

You could in advance set a trusted phone numbers for your Apple ID. Then when you want to log back into the Apple ID, you can click "Didn't get a code" to have the code sent to your trusted phone number via text message or automated voice call.

Another possibility is to sign in to the Apple ID with a browser. There you can select to trust the browser. Then you will be able to sign in to the Apple ID using that browser on that specific computer without having to enter a 2FA code. 

You will find Apple's guide for two-factor authentication here:

https://support.apple.com/en-gb/HT204915