Are you migrating to a new operating system (Windows, or quite possibly any) and failing to setup your Gmail account in Thunderbird (version 68.1.2, and surely many more)? Getting a small popup which says "Authentication failure while connecting to server imap.gmail.com.", in the bottom right corner of the window, with only an 'x' to dismiss the message? Despite Thunderbird restarts? And even OS restarts?
If you're like me, you're in luck, the solution is very simple : just connect to Google. That's right - open a browser, go to Google, connect. And then just retry connecting in Thunderbird (or restart it).
And that is how intuitive it is to use a top 2 MUA with a top 2 mail service. An MUA from an organization who's done tens of millions of USD-s in business cooperating with that service's provider. Congratulations, Google
Welcome to 2019
P.S. For those less lucky, see the "Less secure app access" section in https://myaccount.google.com/security
I figured this one out thanks to this long thread (get ready to click "more" several times to reach a useful reply).