2 of 3 added 2 characters in body; edited tags; edited title

How to close a program like vim in command line (im really new to linux)

I know this is more of a general linux question but w/e. So when I enter a program like vim in the command prompt it displays all the text in the file and I can edit it etc. But I can't figure out how to close or save the file and get back to the command prompt without killing the process. Any help is appreciated.