You've tried all these?
Mac's Mail App is not as modern as iOS's Mail app, Many eMail providers now require a separate App Password different from your eMail password…
If it's an IMAP account, delete it in Sys Prefs Internet Accounts then use "Other" instead of gMail choice to add it.
Most likely biggest factor is using Other in Mail setup, then using a Browser that doesn’t have gMail PW stored init to get the App PW.
It might just need an App Password separate from the gMail password…
https://support.google.com/a/answer/9003945?hl=en#apple-mail&zippy=%2Cset-up-gmail-with-mail-on-a-mac
https://discussions.apple.com/thread/254920541?answerId=259158920022#259158920022
https://support.google.com/mail/answer/185833?hl=en-GB
Apple Mail won't sign in to Google account - Apple Community
my iMac has OS Yosemite 10.10.5 Does this… - Apple Community
my iMac has OS Yosemite 10.10.5 Does this… - Apple Community
gmail on mail Version 11.5 (3445.9.1) - Apple Community
gmail on mail Version 11.5 (3445.9.1) - Apple Community
Note from PrestoWebDesign…
https://discussions.apple.com/thread/253701684?answerId=257151754022#257151754022
Trying to add Gmail account to Apple Mail… - Apple Community
https://blog.google/technology/safety-security/the-beginning-of-the-end-of-the-password/
Possible gMail fix…
Apple Mail App Not Functioning - Apple Community
https://discussions.apple.com/thread/254931663?answerId=259192691022#259192691022
https://discussions.apple.com/thread/254659965?answerId=258757070022#258757070022
Also Mac's Mail App is not as modern as iOS's Mail app, Many eMail providers now require a separate App Password different from your eMail password…
Then you may need Ways to securely access AOL Mail…
https://help.aol.com/articles/allow-apps-that-use-less-secure-sign-in
Or it may just need an App Password...
https://support.google.com/mail/answer/185833?hl=en-GB
Yahoo has gone to this too...
https://help.yahoo.com/kb/access-yahoo-mail-third-party-apps-sln15241.html
Yahoo cure…
https://discussions.apple.com/thread/254879377?answerId=259375262022#259375262022
Yahoo App password…
Generate and manage third-party app passwords
Some older, third-party email apps (that do not use our Yahoo branded sign in page) require you to enter a single password for login credentials. To access your Yahoo Mail account on these apps, you'll need to generate and use an app password. An app password is a long, randomly generated code that gives a non-Yahoo app permission to access your Yahoo account. You’ll only need to provide this code once to sign in to your third-party email app.
https://help.yahoo.com/kb/access-yahoo-mail-third-party-apps-sln15241.html
Most likely biggest factor is using Other in Mail setup, then using a Browser that doesn’t have Yahoo PW stored init to get the App PW.
https://discussions.apple.com/thread/255004776
Using app passwords with apps that don't support two-step verification (microsoft.com)
What about application passwords? Will that keep working?
If application passwords are being used for MFA (Multi Factor Authentication) along with basic auth as another auth mechanism, then when basic authentication is disabled, app passwords used for MFA will stop working too.
Where can I find more information?
There are several resources that we wanted to provide here as additional reading:
https://techcommunity.microsoft.com/t5/exchange-team-blog/exchange-online-email-applications-stopped-signing-in-or-keep/ba-p/3641943
Exchange Online email applications stopped signing in, or keep asking for passwords? Start here. - Microsoft Community Hub
It may just need an App Password separate from the gMail password…
https://support.google.com/mail/answer/185833?hl=en-GB
Apple Mail won't sign in to Google account - Apple Community
Note from PrestoWebDesign…
Trying to add Gmail account to Apple Mail… - Apple Community
Trying to add Gmail account to Apple Mail… - Apple Community