You have to create an app-specific password on appleid.apple.com
Apple did launch the two-step verification ages ago, succeeded by the two-factor since.. many months. The only "deed" from apple is to discontinue the possibility to use 3rd party apps w/o 2FA and app-specific passwords.
Long story short: If you have not already switched to Two-Factor authentication or two-step verification, now you must.
If you have no longer an apple device to switch to Two-Factor, you must switch to Two-Step to be able to create an app-specific password. Please make sure that you add more than one phone number afterwards just to be on the safe side.
Be careful, it does only have the recovery key and phone number and password. If you lose either, you can re-create one missing part if the two other "factors" are available, but if a second thing gets lost: doomed you are indeed.
To switch on Two-STEP instead of Two-Factor, there is no other way than via Link:;
Set up two-step verification now
Two-step verification for Apple ID - Apple Support
Using app-specific passwords - Apple Support