How to remove a folder showing an error “Cannot delete folder: It is being used by another person or program”

You surely have met errors while renaming, deleing or moving some file or a folder. When you do some of these operations on a file/folder which is currently open or is in use by some other application, you get any of the following messages: 1) The file is in use by another program or user. […]