Persist through exhaustion; this is a sign of working hard, not failure.
I strongly suspect it is things like this that make the greatest difference.
Where "things like this" refers to... how one almost automatically translates perceptions ("I feel tired") to judgments (either "I am a failure" or "I am working hard"). Things we actually do a lot in our heads, but we either don't talk about them, or just mention them as a side note; because it somehow feels more appropriate to focus on explaining techniques used outside of our heads (pomodoros) or theories (hyperbolic discounting).
Similar example: in a debate about exercising, a friend told me something like: "when you feel exhausted towards the end, that is the feeling of becoming stronger" (meaning: those are the moments in exercise that contribute most to the later increase of strength). Now when I am exercising, feeling tired at the end makes me feel happy, and gives me the motivation to do a few extra repetitions.
On intellectual level, either reaction could be defended; logically speaking, feeling exhausted could mean that you worked hard, but it also could mean that you took a task that exceeds your current capabilities. Neither emotional reaction is 100% guaranteed to reflect reality. (So perhaps the "rational" reaction would be... no reaction at all.) However, people who habitually feel "good work!" are likely to be more productive than people who habitually feel "oh no, I failed again. (And people who believe they feel nothing are probably just lying to themselves.)
I want to share this method I use sometimes to stay focused on my tasks, earn rewards from them, and build up a positive feedback-loop to do more difficult things. It's nothing new and has probably been written about a few times. I have been using it subconsciously for years, and wanted to do an explicit representation for future use. If this sounds completely wrong to you, please ignore it or tell me in the comments.
It should go without mentioning that this is just one part of a well-tuned system. It works because other parts work and support it. If supportive systems are wired differently or broken, this approach may not work at all.
What you need
How it works
Caution! Do not use this to work yourself to exhaustion over time. This is meant to help in keeping up a healthy work-mentality; don't use it to trick your body or mind into giving more than it has. Take steps to make sure this doesn't happen; perhaps set up a reminder for some weeks later, checking that your habits don't stray into forbidden territory. The danger lies in not noticing until it is to late. Be prepared!
How to reward yourself
This might be really different for different people. I build up some habits over the years where, after completing some chosen task or thingy, I would internally congratulate myself, focus on the positive feelings this evoked, etc.
It might take some experimentation. Physical rewards, like a pleasant sound and light effect, a 'Well done!' stamp on a paper (humans are weird, but if it produces the desired results...), can also be effective. This works for children, pets and games, which is why I started using it.
These small rewards don't really matter at all, of course. They are just tools to build up the desired habits. Eventually, when you are working on the things that are important to you and making progress, that may become a reward of its own.