I developed an R package using devtools and usethis, but the GitHub repository is in the master branch. I understood that it need to be in the main. What is the correct setup? If is it the main, how can I switch from master branch to main?
The branch names don't matter. It is just whichever one you build the package from. e.g.
Background on main/master: github/renaming: Guidance for changing the default branch name for GitHub repositories
I'd also add this reference: Renaming the default branch from the tidyverse blog.