The first step is to rename the "master" branch in your local Git repositories:
$ git branch -m master main
Let's quickly check if this has worked as expected:
$ git status
On branch main Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean