A notebook normally consists of a sequence of function declarations and (main-)code that calls those functions. Some functions may depend on others. E.g:
f[x_]:=2*x;
g[y_]:=f[y]^2;
Print[g[4]]
64
In this case, everything works fine since no code uses other code that has not been defined before.
But if we use another sequence, this notebook (or block of code respectively) cannot be executed properly since g is undefined at the time of execution:
f[x_] := 2*x;
Print[g[4]];
g[y_] := f[y]^2;
g[4]
If you have a larger notebook with many functions depending on others, this problem cannot be resolved. You have to execute the notebook once with many errors so that all function declarations are executed. Up from then, everything is fine.
Is there some mechanism in WL like "forward declaration"? I. e. in the second piece of code something like "Uses[g]" before "Print[g[4]]" which will execute the declaration of g before executing "Print ..."
For packages, there is "Needs" which is a similar mechanism.