Didn’t like my job today

I had a productive day planned today, and although I was on track for the first couple hours, my motivation waned throughout the day. My excuse is that I’m trying to solve a programming problem that literally can’t be rushed. I can’t say I’m giving myself one hour to understand where in the code the problem is and fix it.
It’s code that I created and no one else in the company knows, so I can’t ask for help. I’m confident I will solve it, but today I rather bang to my head against the wall with debugging. Then I started buffering, or perhaps I started buffering well before I recognized it as such, by checking my phone a lot.

C: work
T: I don’t know how many more days of this job I can take
F: dread
A: extrapolate into the future that everyday will be like this one, minimize my accomplishments of the day, beat myself up, check my phone a lot, beat myself up mentally for checking my phone…
R: ??

I typed several things, but none of the thoughts feel believable or inspiring. I think the feeling I would like to put in this model is something along the lines of possibility/a feeling of clean slate tomorrow (not sure a one-word descriptor for that).

Sometimes it feels like a helpful thought that tomorrow is a new day, but I don’t know if that indicates less responsibility for the day that’s just ending, or leaves days up to chance? I love your thoughts on this as well as my UM above. Thank you!