...
Go to https://github.com/settings/security and scroll down to the bottom of the page
Click Enable two-factor authentication
Open the DUO app on your smartphone (or another supported authenticator app), hit Add, and hit Use QR code
Scan the QR code that is displayed on your computer screen and hit Save on your smartphone
Hit OK on your smartphone on the Account added! page
Enter the code displayed on your smartphone in the Verify the code from the app field on your computer
Click Download to save the recovery codes on your device and then click I have saved my recovery codes
...