`kill-buffer-and-window` kills the current buffer along with the window. `switch-window-then-kill-buffer` kills the other buffer along with its window.