Found in 3 comments on Hacker News
slipwalker · 2018-07-19 · Original thread
not sure about "the best way", but besides the obvious cases ( factory, singleton ) i apply the Kerievsky's Refactoring To Patterns method.

    “Instead of thinking about a design that would work for every nuance of a system, 
    test-first programming enabled me to make a primitive piece of behavior work correctly 
    before evolving it to the next necessary level of sophistication.” 
    Kerievsky (2002)
https://www.amazon.com/Refactoring-Patterns-Joshua-Kerievsky...

If a piece of code survives long enough to deserve some refactoring, then i take a closer look at the patterns.

loumf · 2014-05-18 · Original thread
There's a great book called Refactoring to Patterns which I would suggest after GoF (and just overviewing the Refactoring book)

http://www.amazon.com/Refactoring-Patterns-Joshua-Kerievsky/...

swanson · 2011-12-30 · Original thread
The first step is to be aware that you aren't writing succinct, manageable code - so you are already making progress :)

I'd recommend these books, mixed with some searching around for best practices for whatever specific framework/language/toolkit you are writing code with.

Clean Code

http://www.amazon.com/Clean-Code-Handbook-Software-Craftsman...

Refactoring to Patterns

http://www.amazon.com/Refactoring-Patterns-Joshua-Kerievsky/...

Fresh book recommendations delivered straight to your inbox every Thursday.