Apple’s two factor authentication feature for iCloud is a little clunky.
Basically, when you have 2 factor authentication set up with iCloud you will need to get the password incorrect once.
Meaning that when you enter your email and password to access iCloud the first time to you do it will always be wrong.
This is essentially required.
Then you should receive a text message pop-up on your connected iOS device with a code.
Use this code after your password.
So, if your password is “password” the password you enter will be “passwordcode”.
Then it will let you get into your account.