this is because in your current position there is no folder named myfolder. The rm comand expect the name of the folder you want to delete, but only if the folder is in the same direction as your terminal.
The problem seems to be that myfolder is in ~, because you run the comand mkdir in ~
Then you move inside myfolder with cd myfolder.
But inside myfolder there is no myfolder to delete so the comand rm doesnt work.
If you want to delete myfolder you must run the command in ~
So how to position your terminal in ~ ?
this go back to ~ also if you dont want to go back to the beginig use the command
this go back to the previous directory. In this case both work.
If you are lost you can do
that print the working directory, and tells you in wich directory you are, and
that the files and folders in your current position.
If there is another doubt ask again.
Hope this will help.