If you assume the outcome of your thesis is a foregone conclusion, this can enable you to work without hesitation. Many fighting chances have been born during last-minute, no-hope efforts, and if yours doesn't come along, treat that as a bridge to cross when you get there.
I know, easy to say when everything feels like it's doomed. I took a shot at building a MVP for a product to start a company with and failed because I spent over half the time messing around, working on what wasn't important.
Six months in, running out of time and money, I started these habits even though I thought to myself that it would be too late for them to matter. I became very productive especially towards the end as a result, and I could keep to my new routine since I figured "at least I'll be getting something out of the whole ordeal".
At the same time, I felt like the situation was beyond salvaging, and the product indeed never saw the light of day. The silver lining is that the habits I picked up when I set myself straight, both professionally and personally, have been immensely useful in the years that followed.
Give it your best. I hope things work out for you.