If you ever accidentally end up inside vi or vim or neovim by reading some tutorials online, you can quit it by pressing Escape, colon ( : ), q (q), bang (!) and pressing return. It is simple as that. Modern version of VIM even tells you that on welcome screen. No need to panic.