To add to this, people will have different opinions on what is "clean". In fact you will have different opinions on what is "clean"!
I've lost count of the times I've written some code, only to come back the next day and re-write it into a "cleaner" version.
Like writing an essay, it takes time and iteration, and sometimes there just isn't a stable solution. This has somewhat helped me in just writing the damn code (but my ADHD brain still habitually reaches for "perfection" over "get it done")