The bias is specific, which is good news
Buehler, Griffin and Ross ran the definitive studies on this in 1994. People underestimate how long their own tasks will take, and they do it even when they know they have underestimated similar tasks before. The detail that makes the finding useful is what happens when someone else predicts your completion time: the bias mostly disappears. Observers, working from the same information, are not systematically optimistic about your schedule.
That tells you the problem is not ignorance. You have the data. When you plan your own work, you build the estimate out of a specific imagined path where nothing goes wrong, and you leave your track record out of it. Someone watching you has no imagined path, only your history, so they estimate from the history.
The immediate practical move follows from that: for anything that matters, ask a colleague who has seen you work to guess. It costs a minute and it routinely returns a number 30 to 50 percent higher than yours. If nobody is available, the rest of this page is about how to imitate the outsider's view on your own.