This article describes how to set up your Gmail account in Mail for macOS 10.13 and later.
How do I add a Gmail account to MacBook and Mac?
The first option to use Gmail in macOS mail is IMAP. Below are the steps to set up Gmail with the IMAP protocol.
Go to Mail > Add Account in the Mail menu bar. (If you haven't set up any accounts yet, open Mail.)
Select Google > Continue.