Why functions change the way you program
Programming well is not about writing more code. It is about organizing logic better.
Every time you spot a repeated pattern, a function is a natural candidate to encapsulate it and remove duplication.
Functions also force you to define a clear contract: what they receive, what they do and what they return. That reduces ambiguity.