In **Settings → Email**, choose the Yahoo preset.

In Yahoo Account Security, choose **Generate app password**, then **Other App**. The username is your full Yahoo email address. The password is the one Yahoo just generated.