Vim is unlike most text editors. There are two modes which you can toggle between.
Insert mode (press i when in command mode)
Command mode (press esc when in insert mode)
When you're in insert mode, you can edit text like you would with any editor. When you're in command mode, you can issue commands. Here are a few common ones:
:w Write the file (save)
:wq Write the file and quit
:q! Quit without saving changes
Vim can do a lot more. Read a more in depth tutorial if you want to become proficient with it.