How to exit vim?
To exit Vim, you can use the following commands:

    :q - exit Vim if there have been no changes to the file.
    :q! - exit Vim and discard any changes you made to the file.
    :wq - save changes to the file and exit Vim.
    :x or :wq! - save changes to the file and exit Vim, even if the file is read-only.

It's important to note that you need to press Esc before typing any of these commands if you were in insert mode, to return to normal mode.
That didn't work, what else can I try?
The most likely cause is user error. Try hitting Esc before typing one of the exit commands listed above (e.g. :wq). Be sure to type the colon, as it is a necessary part of the exit command.

In the rare event that vim is frozen or unresponsive, it may be necessary to forcefully kill it. Assuming you are on a Linux system, this can typically be accomplished by executing the command pkill vim in another console window. This can be made even more forceful by adding the -9 command line flag (e.g. pkill -9 vim). Note that killing vim will cause you to loose any unsaved work, and is relatively inconvenient to do, so it should be used as a last resort.