With the mobile web becoming increasingly important, Facebook relies more and more on its "Code Generator". So, what is it, and how do you use it?
A few years ago, PayPal came out with a secure dongle on a USB stick, which ensured that you'd have to enter the right code at the right time before being able to log into the service, even with the correct username and password.
Fortunately, the software version of security tokens is now the thing, so you don't have to carry hardware around! Facebook's Code Generator is just a screen in the mobile Facebook app that generates a new numeric code every 30 seconds. Once you've enabled Login Approvals to prevent unknown devices from signing into your account, you'll need to enter the current secret code in the "Enter your login code" screen before you can access your account.
Once logged into your mobile Facebook app, tap on the "hamburger" menu button (three horizontal bars). It is in one of the corners of your screen, but which corner depends on whether you are using a phone or tablet, running on iOS, Android, or other mobile platform (on iPhone, it's the lower right corner).
In the menu page, scroll to the bottom and tap on Code Generator. You'll see a big, six-digit code in the middle of the screen. Notice that there's a seconds countdown in the circle underneath: enter the current code if you have enough time to do so; otherwise, wait until the next code appears. Generally, Facebook also accepts a code that has just expired. (From experience, it seems like it accepts both the current and previous code at any given time.)
Sometimes, Code Generator may get out of sync (for example, if you changed time zone, don't observe Daylight Saving Time, etc.) In that case, click on the My code doesn't work button at the bottom. To "refresh" or "reboot" the Code Generator, tap on the Reactivate button to get a new code to enter.