Not using linters
A linter is an automated tool for analyzing code and catching errors. Just having a linter active in your code editor will catch a variety of mistakes like variable shadowing.
Mistake
Not using a linter.
Fix
Use a linter or have code linted by CI.