While I have written about this in the past I feel like it is something that I need to be telling people more often, Almost all computers manufactued right now are either cheap irrepairable junk that breaks easily, or they are fancy irrepairable junk that you are too afraid to use for fear of breaking. Oh and I guess I should say that when I'm talking about computers here I am talking about laptops, the age of the desktop computer is over when Apple caved to years of consumer demand a year or two ago and came out with a desktop computer with a starting price of $5,999.00 which could be configured to cost well over $50,000 they weren't only doing it to ensure they had the best possible thing on the market, but when they put it at a price that made it unatainable for the average person they were sending a message to the average person that they did not need a desktop computer and they were right. Unless you have kids whose online activity you need to monitor, or you are a hardcore gamer, you do not need a desktop computer.
You also do not need a computer with all the latest chips in it, I've explained this before and this article also does a gret job at explaining this. Interestinly enough Google also figured that out, that is why chomebooks exist. Google figured that if all that you'll ever do with a computer is browse the web, stream movies, and edit the occasional word document then it makes perfect sense for them to sell a laptop that could only do those three things. Chromebooks are cheap and they do what they need to do however I will say that you should never buy one since they still suffer from being irrepairable junk, they are absolutely useless when it comes to doing actual work which is of course what a computer is for (I've been in classes where people have walked in with a Chromebook and been told to either buy a new computer or drop the class since their Chromebook couldn't actually do what the class required), and of course they have almost no storage capacity so you're forced to store everything in Google Drive so that Google can see all your stuff and you will always be forced to be connected to the internet to acess your files.
Now I've gone off on to many tangents and I guess I'd better get to talking about what I actually meant to talk about which is the type of computer you should be looking for. You want a computer that is easily repairable and upgradeable with an external battery. If the $5 wi-fi card on your laptop goes out you should be able to go to a computer parts store, buy one for $5 and then only have to spend ten minutes replacing it, your computer should be easy for you to work on so you don't have to waste money getting someone else to repair it or having to buy a new one all because your $5 part stopped working. You also want an external batterey since these are safer and if you're buying a used laptop you will probably want to replace it anyways. Old Thinkpads are the perfect example of a good laptop to buy, my main computer is a Thinkpad T420, the T420 to the T460 or so are the sweetspot of Thinkpads since they have modern chips but are still easily repairable and easy to find on ebay (often with 12 to 16 gigs of RAM and SSDs). Of course there are plenty of other models of Thinkpad and computers from other manufactuers from this era (2012 to 2015ish) that fit this description as well and all of them can be bought in good conditoin for under $300 on ebay, you'll get a lot more out of spending your $300 there than you would by spending it on some cheap underpowered laptop being sold new now.
Of course the question is when does your computer need replaced? Well to determine this you have a few questions to ask yourself (I'll make a flow chart with them all below). If your hardware is broken beyond repair that is an obvious cause for a new computer. If you are happy with how your computer currently runs than you shouldn't buy a new one. If your computer is running slow but you need to use Windows for something than you should look into a new computer, but if you are just using it to browse the web and edit the occasional word file then putting Linux on it will make it run just like new.
Anyways the moral of the story is to avoid wasting money on stuff you don't need and learn to thrive with the stuff that is better suited to last years. My T420 will be nine years old this year and because I have put good parts in it i expect many more years out of it, you should be able to say the same of your computers and really just about everything you own.