(1) Do aerobic exercise. Ideally a lot of aerobic exercise, like you were training for a marathon. Two hours a day of cardio would be great with maybe 2 days off a week. Don't let that get in the way of doing 30 min or 1 hour, or some serious walking or running.
(2) See your primary care doc. You should get your thyroid checked, maybe some other general workup. Consider a prescription for an SNRI or SSRI antidepressant. For best results you should start with a low dose and follow up with your doc to possibly increase it or try something else.
(3) See a talk therapist. In my area we have a service called "Family & Childrens" which is good quality and takes health insurance but has a long waiting list. Betterhelp doesn't take health insurance but can have you talking to somebody almost immediately online.
I also don't think framing any difficulty as "being lazy" or "spoiled" is helpful, especially if you're directing that at yourself. Even if it were true (which sounds unlikely to me!) there's no actionable step to fix being lazy, so it's worth ruling out the other potential causes before you write yourself off like that.
So the useful thing to do, and the one that is most kind to yourself, is assume you are not just lazy. You are having some kind of struggle, but let's take "lazy" off the table for now.
Others here have mentioned ADHD, anxiety, burnout, sleep apnea, or depression. These can definitely all lead to the kinds of symptoms you're experiencing, and it's worth talking to a doctor and a therapist to figure out what could be causing this.
I've been in your situation (I'm 33, but working since I was 15, the last 3 years looked eerily similar to what you've described). I'm significantly better now.
Therapy, changing my lifestyle and focusing less on work helped. I wish I had done this years ago. I'm still struggling with this sometimes, but I also realised that I feel better than I could even think it was possible.
Another thing that really helped me was finding a job I didn't care much about, spending more time doing nothing.
If you're like me, you probably feel like you're already doing nothing, but at the same time feel compelled to fix that by trying to do more and blaming yourself for not caring/not being good enough/being on the verge of becoming unemployed/ Doing nothing is good. Then, with time, simple ideas might pop in to your head once in a while, but you won't feel pressured to implement them, you will just make something for fun. In my case it's building small toys (like https://sonnet.io/posts/reactive-hole/) or doodling, anything not too serious really. You're not lazy. It's literally the opposite-your body is telling you how tired you are. I'm not a therapist, but if you want to chat or just rant* I have coffee/office hours set up to meet people, exchange experiences, learn from them, or just talk about random stuff--it doesn't really matter. [*] Those 3-minute rant meetings usually end up being 2h long conversations, but they're really fun.
- I recently had some long conversations with coworkers who experience similar problems with motivation. I was especially surprised to hear it from one person, who--from an outsider's point of view--maintains an insanely high level of work ethic. His approach seems to boil down to having a top-down self-identification with his role and a bottom-up maintenance of good habits. So from one side he identifies as a professional who meets deadlines and is committed to doing good work. From the other side he tries not to work on the same task for too long, recognizes when he's starting to feel burned out, communicates it honestly to his manager and coworkers, and takes breaks to work on other more rewarding tasks, or just breaks from work altogether. His attitude reminded me a lot of the ideas in the book Atomic Habits, which is worth reading if you haven't already.
- It's easy to underestimate how much a change in environment changes your perspective. When I'm in a depressed mood, everything looks the same and I can't imagine how things could be less "true" in the future. In a different mindset, the bad things are still true, but seem less relevant. All software jobs *are* roughly the same, but having different coworkers, solving different problems, even working in a different building can help trigger a change in perspective.
- Do you have a good sense of what it is that *would* motivate you? Or what you want? Is there a particular part of the process of architecting software that you find satisfying? Or maybe a product or company whose mission aligns with your values? Personally, I'm most often stuck in this part. If nothing motivates you, it's likely more than work burnout and you might want to take some time to focus on your mental health.
- If you know what you want but struggle to set goals and make steady progress towards achieving them, I think it comes down to discipline. I've found that for certain things, if I wait for motivation to strike I'll be waiting forever, and unhappy the entire time. Sometimes detaching a bit and forcing myself to do something triggers a little bit of dopamine that inspires more momentum.
Usually we develop a habit of working harder when things aren't going well, but at times you have to scale this down.
Maybe take a vacation. Vacations don't mean flying off somewhere. What do you want to do? Sleep? Watch anime? Learn guitar? Do that for 3 days.
New job would probably fix some things, for a while. A change of scenery can do a lot. Working on code you haven't been staring at every day, solving different types of problems, working on a legacy codebase, etc.
I say just smoke some pot and chill out. Enjoy your family. Explore other perspectives. The job really isn't that important. In fact, maybe that's why you feel how you do.
Best wishes.
How do you define lazy? I like to re-frame that term somewhat positively, in that you could do the bare minimum to get by, and being creative in avoiding conflict or drama. You could also re-frame it as avoiding stress, getting adequate delicious sleep, and being well fed on a low-budget. There is a saying I often refer to:
'Avoiding work is oftentimes the most hardest of all work. Looking busy is a whole art-form in itself'.