That didn't work I have a sinking feeling that the problem may be with Google, who my carrier (Telus) chose to hand the mail system over to a couple of years ago (G Suite).
At one time, Google's IMAP was a semi-compatible proprietary hodgepodge, but like Microsoft, they finally realized their proprietary standards were counter-productive and dropped the proprietary features in favor of industry-wide standards for IMAP.
Among other things, I've seen this caution:
A suspicious app was blocked from accessing your account
Google prevented someone from signing in to your account using a non-Google app. If this wasn’t you, they know your password and you should change it immediately.
I generally avoid Google every way I can, but, I do have a Google Group eMail account and between a Mac, iPad, and iPhone, it is accessed using Mail roughly 864 times a day, without triggering any such warning. But I have received very similar messages, apparently
phishing for my password, reputing to be from other accounts including Amazon, my bank, and American Express. Rather than reporting the incident to Google's technical support, I suggest reporting it to
Google's fraud department. FWIW I found that link using DuckDuckGo, not Google.
Can you provide a little more detail than “That didn't work”? Specifically, what are you doing? What are you expecting to happen? What is actually happening? What macOS version do you have? What iPadOS versions? Don't forget, screenshots are sometimes worth more than 1,000 words.