git checkout -b branch-name origin/branch-name: To create and connect with a branch on remote. (it checkout from main to desired branch name and connect it)
git branch --set-upstream-to=origin/branch-name: If you are already in desired branch you just need to connect with that remote branch.
git push origin --delete branch-name: For delete remote branch.
git branch -d branch-name: to delete a branch that is merged and now not need in local.
git branch -D branch-name: to delete a branch neither merge in remote nor deleted.