Do the task by hand before you automate it
Before building an automation for a process, do that process by hand a few times first. You need to understand every step, including the odd exceptions, before you hand it to something that will run without you watching.
This matters because automating a process you do not fully understand just means the mistakes happen faster and more often. I have seen people automate a step they had never actually done themselves, only to discover mid-build that there was a judgment call buried in the middle they had no idea existed. Doing the work by hand first surfaces those hidden decisions while they are still cheap to notice.
Write down every step as you go, including the ones that felt too obvious to mention — those are often the ones an automation trips over.
Try this today: pick a process you are planning to automate and walk through it by hand once more, writing down every single step.