Welcome to Justanswer.com, my name is ***** ***** I will do my best to assist you.
On your macbook, if you use safari and go to gmail.com
Can you sign in on that page using your full gmail address and last working password?
You should be able to open up a second page, or second tab within safari. That way, you can keep our page open.
Yet still use the second page to go to Gmail.com through safari. And then, try to sign into your gmail account using safari.
Once we know whether it will let you in via safari, that will tell us how to fix the issue with your mac mail program.