Login - Screen Flashes and Returns to Login Screen - Terminal Explanation
To rename the folders you listed in Terminal you would use the move command or "mv". Like this: (I will use an account called "userx" for this example)

sudo mv /Users/userx/Library/Preferences /Users/userx/Library/PreferencesOLD
sudo mv /Users/userx/Library/LaunchAgents /Users/userx/Library/LaunchAgentsOLD


To create directories in Terminal use "mkdir"

sudo mkdir /Users/userx/Library/Preferences


Lastly, the step they skip is allowing "userx" to use the new directory you need to make userx the owner of any new folders you create in this manner.

sudo chown userx /Users/userx/Library/Preferences