1) Create an app password here
2) edit your configuration file:
'mail' => [
'fromName' => 'Joe',
'fromEmail' => 'joe@example.com',
'smtp' => [
'server' => 'smtp.gmail.com',
'port' => 587,
'security' => 'tls',
'username' => 'joe@example.com',
'password' => 'app-password'
]
],