How to remove branches in git that are no longer remote?

Standaard

git fetch -p

This does the magic, and unmerged local branches will not be removed.