And if you abuse things like https://github.com/dortania/OpenCore-Legacy-Patcher/releases you can keep running "modern" releases on older hardware.
But it depends on what you're trying to do.
It is often worth selling the dead one for parts to someone else; even if the logic board is dead the screen is likely to be useful.
I've also had 3 year old Dells, HPs, Lenovos, ASUS, you name it... all die prematurely. I don't honestly believe that any particular company uses any better quality hardware than another. Not measurably better, at least. You're just gonna win some, and lose some, no matter how much you pay for the hardware. This year's most reliable laptop could have a revision next year that makes it the worst laptop...
With laptops and proprietary desktops especially, it's sometimes worth paying for the extra warranty.
As a counter anecdote, I've done this three times for macs so far, and all of those still work for their intended purpose. The 2011 model even survived overheating due to user error and fried its internal graphics cables but works fine with an external monitor. And sure, they're all stuck on whatever their respective latest operating systems are, but that's fine: they're test/compile machines, not daily drivers. And not all of them: in 2022 the oldest realistic mac target you're looking at is the 2015 macbook pro (i.e. "the good one", that even today's models can still take design lessons from).
And here's the best part: if something in them breaks, replacing the entire machine is only a few hundred bucks. Which you don't have to: you just need to buy a "for parts" with the bits you need still working. Any model that's still being used in the wild still has a decent sized for parts market. You can tell when the world stops using a model when the parts dry up.
I have a 2006 Intel MacBook that still works but I've also had 3 year old Macs just quit working.