By default when we open a file in vim, we are staying at command mode. In this mode we can do action like move, search, copy, delete line and so on.
Then if we want to change to insert mode which allow us to write texts into a file. Then we just need to press I or insert for insert mode. Then if you want to go back to command mode you just need to press esc.