Refactoring improves the design of existing code and enhances software maintainability, as well as making existing code easier to understand. Original Agile Manifesto signer and software development thought leader, Martin Fowler, provides a catalog of refactorings that explains why you should refactor; how to recognize code that needs refactoring; and how to actually do it successfully, no matter what language you use.
Examples are written in JavaScript, but you shouldn't find it difficult to adapt the refactorings to whatever language you are currently using as they look mostly the same in different languages.
"Whenever you read [Refactoring], it's time to read it again. And if you haven't read it yet, please do before writing another line of code." -David Heinemeier Hansson, Creator of Ruby on Rails, Founder & CTO at Basecamp
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." -M. Fowler (1999)