Is there a general pattern/structure/format to most (if not all) computer functions?
A method is just a precise sequence of instructions (in the ordinary English-language sense of the word) of how to perform some specific task. It's certainly true that many tasks&nbsp;&ndash; and I mean this in a completely general sense, not just computer programs but things like recipes, travelling to work, repairing a bicycle, building a house&nbsp;&ndash; follow a general pattern of "get things ready, do the main part of the work, then tidy up." However, there's no reason that all tasks must follow this pattern, and certainly not at the level you suggest of looping, then doing conditionals, then returning something.  In general, methods do whatever it is that they need to do to accomplish the specific task at hand: ultimately, everything really is its own unique snowflake.

Having said that, we should note that we could, in principle, force everything to have a particular pattern. The CPU itself is essentially a loop of "read the next instruction, obey that instruction" where a particular effect of obeying an instruction might be to change what the "next instruction" will be&nbsp;&ndash; that would be a jump or goto. So, in principle, we could write every program in this style. However, people find this kind of program extremely difficult to write, understand and debug so, in practice, we use higher-level languages, and use compilers and/or interpreters to translate them into terms that the CPU understands.