The structure of a method can often be made clearer by splitting it
up into smaller methods. Martin Fowler, author of Refactoring, is
an enthusiastic advocate of this style.

Refactoring an original method into smaller pieces has several advantages:

it allows the original method to stay at a higher level of abstraction,
which always increases legibility

it makes the original method simpler

it reduces the number of local variables in the original method

it allows method names to automatically document the intent of the code

Sometimes a comment is placed at the start of a chunk of code, explaining
its intent. If a clarifying method is used instead, then the chunk of code
gets refactored into its own method, while the comment itself is replaced
by a call to a well-named method. "When a comment grows up, it becomes
a method call".

Example

Here, the method parseSearchText, which was originally monolithic,
has been refactored to call several private methods which perform
very well-defined, simple tasks.

Boolean conditions can often benefit from being placed in their own
method. Here, isDoubleQuote, isCommonWord, and textHasContent
are all examples of this.