Mac - How to enable (turn on) two-factor authentication for your Apple ID

Get verification code for two-factor authentication

Then you will be asked for your Apple ID password like this See here for other Apple ID related information.