What you do you become.
That is a very old saying, dating back to the roots of taoism.
The human mind is a feedback system, everything gets amplified until infinity, same way when you point a tv-connected camera at the TV. The feedback loop creates kind of a psychedelic imagery. The same happens with the mind — every thought and action spreads this way, further fueling each other, like a snake eating it’s tail.
Everything you do and think is interconnected. Your neural structures change to adapt to what you are currently experiencing. Basic example is the muscle growth and the muscle memory — you neural networks change in a way it is easier to use the muscles you use the most. The cells in your muscles are subjected to hypertrophy when stressed and damaged (anti-fragility basically).
In the same way, when you want to “clean your head” — some people just start washing dishes, cleaning the house or go for a run, a swim or meditation and let the thoughts flow. Your mind then adapts on what the task at hand is, changing the neural structure to adjust for the activity.
More complex example of the mind adaptation is drug addiction. Your dopaminergic system adapts in proportion to the amount of active compounds of the drug used — “you build up tolerance”. It happens with everything — sports, coffee or games. In case of sports your body stays in homeostasis until you break free and “ascend” to the next level, and from there you need more and more. In case of coffee — you have lived through that one I am sure — having one cup a day, next week it’s 2 cups and so on. The withdrawal symptoms when quitting cold turkey depend on the depth of the caffeine addiction.
To wrap this up — if you want to get your mental mess in order, you should maybe start with cleaning your surroundings, your room, car, PC desktop and the kitchen sink. That way your mind clears too, and if you keep at it, the order will spread to other domains. Your writing becomes clearer, your coding becomes clearer and your daily agenda will be easy to follow without peeking into the calendar. In turn, your clear mind will allow you to do even more tasks in a clean and efficient way, further strengthening your will.