How to enable 2FA for GitHub
Install Authy
The best way to manage all your 2FA accounts is to use the Authy app. It enables you to have a single mobile app for all your 2FA accounts and you can sync them across multiple devices, even accessing them on the desktop. Install Authy on your device by searching for it in your deviceβs app store.
Important: If any sites prompt you to use Google Authenticator for two-factor authentication, note that you can always substitute the Authy 2FA app instead. Although they work in similar ways, Authy is more feature-rich and allows for multi-device syncing, cloud-backups, and easier account recovery should you change or lose your phone or device. Read more information on the features of Authy here.
Locate 2FA Setting
Login to your GitHub account open the menu from the top right icon that shows your account image. Select βYour Profileβ.

Click on the βEdit Profileβ button from the resulting page. There are two buttons you can use, choose either.

Finally select the βSecurityβ option from the menu on the left under βPersonal Settingsβ.

You might need to re-enter your password.

Capture QR Code
Click on the βSet up two-factor authenticationβ button top right, and select the βSet up using an appβ option.

Then scan the QR code with Authy.

Once the token is in Authy, type the resulting 2FA code back into GitHub and click on Continue.

Complete Enablement
Finally, make a record of the recovery codes. Although if you use the Backup feature in Authy, this step isnβt important.

After clicking on the βEnable two-factor authenticationβ button, you are all set!
Head to GitHub for more information on their two-factor authentication security.