/var/run/user/1001 is a directory for temporary run data. You can safely remove it and create it under the ownership of your normal user again.this is a critical operation. Tell me the commands that I should issue,please. I don't want to risk to damage the system severely. I'm using the intel (i915kms) driver. And I propose you to update your tutorial,if it is needed.
Anyhow I will not spoon feed you on how to remove and create a directory and how to change permissions.
Look at rm(), mkdir() and chown(), or Google it