Tip #1 — don't try to write clean code.
Try to solve the task with best quality possible.
The quality of outcome (how reliable, performant and stable to edge cases your feature is).
Clean code will eventually and naturally come. Don't waste your energy starting from wrong side.