You don't use a text editor to delete a file (have you ever deleted a file with a text editor?).
Use the rm-command, in this case
Code:
rm /var/lib/pacman/db.lck
You need to be root to do that.
If you need more help with basic commands, like cd, rm, and so on read a tutorial on these, like
this one.