Writing software is about problem solving skills which improve with practice. Often the process involves breaking down a problem into smaller pieces and breaking each of those down, until you know how to "solve" each problem.
Writing down each "solution" and stringing them together is then the actual "programming" part of this activity .. which brings with it a whole new layer of "problems" to "solve".
It's as much art as it is accounting and the more you do it, the better you get at it.
Source: I've been writing software since 1982.