The initial set up of two-step authentication requires you to have your phone available. You will need to receive a text message or be able to install and use the verification app.
Following this, you should use your phone to access verification codes, allowing you to log in via single sign-on on any subsequent untrusted computers. You may find it useful to keep printed copies of your backup codes if you've left your phone behind.
I can't use my phone to generate a code
You should either sign in using a trusted device or use a backup code to sign in. Then visit the two-step authentication webpage to check you have set up the Google Authenticator app correctly to generate verification codes. If you want to receive verification codes by text message then you can verify your phone numbers are correct on the Security Information page, and remove any numbers that you don't want to use.