How To Exit Vim
How to quite Vim?
Well, there are multiple options.
That largely depends on whether you want to abandon the changes you made or save them.
Esc to get back to normal mode.
:qa!to close all files and quit abandoning all the changes
:wqato save all files and quit
ZZin normal mode writes the current file and exits
:xsame as above
There's not much more to it, but if you want, you can read help docs
:help quit, which is always a good idea.