How to fix "Support for password authentication was removed on August 13, 2021" GitHub error.

GitHub has moved away from using simple passwords to sign in to an account. So you may end up running into an error like the one below:

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/<USERNAME>/<REPO_NAME>.git/'

So, to fix this error, create a Personal access token on GitHub: GitHub > Settings > Personal access token > Tokens (classic) > Generate new token. It'll look like this: ghp_sFhFsSHhTzMDreGRLjmks4Tzuzgthdvfsrta

Then in Keychain Access (NOT Passwords in System Preferences), search for github and update the password for the one that says "Internet password". Tick the Show password toggle and update the password to the personal access token from GitHub.

Credit: STA and idembele70 from StackOverflow