Often new users face problems with lingering definitions that, if unaware, may cause unexpected and frustrating behaviour.
There are several answers that illustrate different aspects of the solution, but not a single place that can serve as a guide where the best strategies are compared side by side.
For example, in this answer @celtschk points to the need of using
ClearAll[Evaluate[$Context <> "*"]]
in the cases when the Notebook has a
Context set to "unique to this Notebook".
This answer by @LeonidShifrin compares
In this other answer @Szabolcs gives an extensive explanation to the "significant practical differences" between
And here @C.E. points to the use of
Needs["Utilities`CleanSlate`"] CleanSlate; ClearInOut;
Ultimately the advice seems to come to actually closing the kernel and starting one fresh, either via
But that doesn't cover preventive measures nor the possibility of a
Dynamic cell in the notebook, or initialization commands or any other mechanism that could re-spawn definitions.
Here I'm hoping for a canonical guide to the problem of a fresh kernel.