If Yahoo asks you to confirm a verification code, there is two possible reasons. You try to log in from a new device or new location, or you've enabled the Account Key.
In this case, you can use a device that you've already used to log into your account, or use the Yahoo Mail app to disable the Account Key, if you have access to it.
If these solutions doesn't work, go to the Sign-in Helper to try to recover your account, using your recovery methods.