It's a really tough tendency to fight. One thing I think is helpful is to acknowledge failure as early as possible. If meeting the deadline would require me to work faster than normal or make some heroic last-minute effort, I've already failed, even if that deadline is still a long way out. Admitting that to myself and others now, so that expectations about the future can be adjusted, is a much smaller blow than admitting it weeks or months down the line. And it means I only have to feel a little flaky and underperformant, rather than super flaky and underperformant and also dishonest.
[1] https://80000hours.org/podcast/episodes/depression-anxiety-i...