Good to know I’m providing a valuable service
I've avoided many mistakes due to my friend's sobering assessment of things and I've done the same--though arguably much less so--for him.
At the same time, he serves the opposite purpose, too. He'd build up an idea that he saw value in, which others missed, and would go all-in on it. He frequently referred to the biblical idea that "iron sharpens iron". It's not really the way people operate, but if you're willing to sign on, it'll change your life. :)
> Maybe I just need to be honest with my managers/co-workers and say that I can't focus on my project and I need some quick wins to get back to being productive.
You're right; I wouldn't necessarily use those exact words, but back when I was at a large telecom, my entire job was made up of projects that I created while being briefly burned-out on something else (usually on time outside of the 40-hour work-week). The additional upshot is that it often led to great improvements in whatever I was stuck on, because I'd pick a project that had a related design complication/issue where that issue was easier to solve/reason about[0].My usual approach would be to say "I'm stuck on a few things with this project, but I have some ideas -- I just need to try them out on something simpler, so here's what I'd like to do" and follow with a well reasoned argument that serves more than my own sanity as its benefits. Most of the people I've worked for don't require much in the way of an explanation[1] but a few have been difficult -- but I solved that by changing positions since this only happened to me at the global telecom I worked at (it was also a small factor in my accepting a position at another company[2]).
[0] For various reasons -- sometimes it was written in a language that I wasn't familiar enough to understand the more advanced usages of it, sometimes it was just really complex code that I fully understood the design/code behind each of the pieces, just not "as a single thing".
[1] With no real correlation between "dev" and "non-dev" managers. I've had non-dev managers that are very receptive because they trust me, and they recognize they don't have the knowledge to challenge my conclusions, and I've had non-dev managers that think manufacturing widgets and writing code are perfect metaphors. I've had dev managers that hear the first part of the argument and say "do what you need to do" and dev managers (usually less experienced) who believe there's no difference between a small CRUD app and a globally distributed, multi-threaded access auditing, requesting and provisioning system.
[2] I hesitate to mention it -- the gentleman involved was a fine manager, he just didn't work with any of the technologies that my expertise was in at the time. Over the last decade, I ended up studying the things he had expertise in, and I'd be willing to bet this factor would have gone away, entirely, had I already had this expertise.
If it's a relatively new thing, you might be going through a little burnout. I've been there a few times.
The first time it happened to me, I almost "fell out of it" by accident. My day job was in a bit of a lull at the time and I just decided one day that I'd had it with a lacking feature in Visual Studio and decided to sit down and figure out how to write an add-on shortly after waking up on Saturday. I ended up completing a really basic version that day -- enough that I knew I could do the rest of it, which I continued to work on for about a month until I released it.
I did this all during a handful of free evening hours during the week, but I checked my download counts regularly and was giddy every time they went up. I can't tell you when the burn-out ended -- probably that following Tuesday -- but any time I start to feel that way, again, I look at what I'm working on that I'm really excited about and I often find that there's nothing there. So I look for something new, usually not day-job related, with the goal of it being "far enough outside of my wheelhouse as to require a decent amount of new learning" and "not terribly difficult to do once that learning is over" because if I can't quickly get to a working "something" on a project like this before I close the IDE, I'm unlikely to revisit it. Ideally, that new learning leads to some new things to work on at the day job, too.
[0] Friends are often not the best unless you have a friend who is not afraid to insult you/the "hard truths". I've had a very close friend for most of my adult life that has been willing to say "You're being stupid/evil/what-have-you" when it was necessary.