only

You can close all windows except for the current window by using the ex command only.
:only

Alternatively you can use ctrl-w o.

Further Reading

:h :only :h CTRL-W_o

More Gifs