One of the sure ways to know when I’m about to make mistakes is when I suddenly feel super-clever and feel like I can do anything. In most cases after such a feeling comes, I end up doing something I regret.
The Dunning-Kruger effect is the cognitive bias which makes one overestimate one’s own cognitive abilities. One needs to keep this in mind and watch for such occurrences. It could save one much embarrassment later.
Watching for one’s own ego (as it usually ends up harming oneself) should be one of the practices and routines one follows regularly as recommended by stoics such as Seneca.