Last month, my wife's computer died.
The trackpad started glitching out, the battery couldn't hold a charge despite not being very old, and it had trouble accessing the boot disk. After some basic triaging, I determined that any potential fix was worth more than the computer was.
It was totaled.
I bought that computer in 2011 for my personal use before giving it to my wife. Back then Macbook Pros were upgradeable without too much fuss: if you wanted to add more RAM or a larger or faster disk, it wasn't difficult at all. And that's exactly what I did. I doubled the RAM in the first year, then I bought a 1 TB hard disk, and then, once prices were more reasonable, I bought a SSD and added it.
The computer, amazingly, got faster over time. OS X "Lion" was truly awful when it came to speed, but in the years that followed, OS X and subsequently macOS got faster. That combined with my hardware upgrades meant that the machine even in its final years felt speedy. In many ways it was faster than the "upgrade" I bought used via eBay that was manufactured a couple of years later.
In addition to the upgrades, I also made repairs. The most significant was changing out the keyboard after it started glitching out. That was a major operation that lasted many hours, but it fixed the problem for much less than a new computer. I also changed the battery and replaced faulty RAM sticks. When colleagues had problems with their Macs of this vintage, they'd bring them to me for the repair. This actually got us a free used computer after I revived a Macbook Air with liquid damage that the owner had given up for dead.
When I bought it, I paid up for several upgrades, but I was determined to wring every ounce of life out of that computer. And I did until it finally became untenable to do so anymore.
This is not meant as an endorsement of Macs, but instead, it's meant to be a reminder: if you pay up for something because you believe it will last a long time, then you actually need to use it a long time to get that value from it.
I've saved myself a lot of money on unnecessary replacements by asking myself, "Did I buy the thing I want to replace while thinking that I would be able to use it a more or less forever? Have I reached forever?"
If not, then I don't buy a replacement.
Obviously, "forever" isn't literal but means instead until the product becomes untenable to use. It's up to you to define what that means, but "totaled" is a good concept here: once a product costs more to repair than to discard, it's probably time to move on.
For example, I'm saved a lot on clothing with this Q/A. Boots and coats are expensive, but they're also fashion items subject to our whims. I'd love to buy the next fashionable "keep it forever" item, but I'm already in possession of several. So the better course of action it to look at what I already have and then take care of it, either through repair or basic maintenance.
I'll add that cars also fall into this category. With proper maintenance, modern cars can last very long times. When I owned my last and only vehicle (since we're car-less now), I was a regular at the quick oil-change place and the various mechanics I trusted. I drove a 1999 vehicle until 2013, and I sold it for a still respectable price once I had to. Had we not moved abroad, I assume that I'd still be driving that vehicle.
In all cases, beware the story you sell yourself to convince you that a new thing will be the real "keep it forever" item. Look at what you have and ask whether it's really and truly done for, or if you're just in the mood to spend some money.