How do you delete a branch locally and on the remote?
Delete it locally with git branch -d name (or -D to force), and delete it on the remote with git push origin --delete name. They are separate; removing one does not remove the other.
Explain it simply
A branch can exist in two places: your laptop and the GitHub server. Deleting it from your laptop does not touch the server copy, like removing a contact from your phone but not from your SIM backup.
-d is the safe delete; Git refuses if the branch has commits not merged elsewhere. -D forces it. For the server use git push origin --delete feature/x. Other people's laptops may still show origin/feature/x; they clean it with git fetch --prune. You cannot delete the branch you are currently on, so switch away first.
Example
git switch main
git branch -d feature/login # safe delete
git branch -D feature/experiment # force delete
git push origin --delete feature/login # delete on GitHub
git fetch --prune # clean stale remote-tracking refsWhat to say in the interview
"git branch -d deletes a merged local branch, -D forces it, and git push origin --delete removes it from the remote. They are independent, and teammates can tidy their stale remote-tracking branches with git fetch --prune."