Some things that help / helped me:
1. Some serious self-reflection about what the problem is: What are the things you do vs don't enjoy about your job? Do you really like what you're doing or are you doing it because of money, goals you set for yourself / you think this is the most prestigious type of company / problem / etc? Is the problem with yourself or the people you work with? Have you ever been happy at work before (at any job you had) and what was different about that? Or perhaps are you not sure about what you actually enjoy? Or are you just tired?
2. More self-reflection about what work means to you as a person and why: Is your job also your passion? Are you proud of your technical achievements? Do you have daily work hours or do the boundaries blur? Do you put in more work / care more about things than others (e.g. code quality, arguing for the right technical decision)? Do you feel especially good when people tell you you did a great job or somehow acknowledge that you're smart? Do you feel disappointed, unappreciated or like there's something wrong with you if you fail to get this kind of feedback? Not saying this is always the case, but for me they're warning signs for a type of relationship with work that's prone to burnout sooner or later. Maybe talk to a therapist about this kind of thing to help you sort out your stance on this, or just generally about a downward spiral in mood.
3. A big break - unfortunately not everyone can afford this but I'm assuming an engineer with a decade of work experience like you probably can. Go do something else for a while. Definitely a month. Maybe a year: e.g. take a job that's not the most technically or personally challenging but will give you other things: more work-life balance, meet interesting people you wouldn't, will expose you to different subjects you like, give you more freedom with your approach, let you play more. For example, I worked at an academic research center for a few years and it was not without its own challenges but overall broadened my horizons a lot. This isn't going to fix your problems in the long term but maybe you'll realize truly how things can be different - the benefit of perspective.
4. Some small "daily life" changes (obviously huge caveats here about lots of people not being able to afford / allowed to do this stuff but again software engineers usually have this kind of nice privilege, so why not take advantage): Some example ideas: Try to do less things at once, maybe work on one thing at a time even. Work on something with someone you like. Take 5-6 Fridays or Wednesday afternoons off in a row: just see how lessening the load a bit or breaking up the work helps. Enforce a hard-cutoff deadline in the evening. etc.
Now, to actually follow my own advice ...