4 simple principles will allow you to keep your electronic gear longer: (1) choose to last, (2) use without damaging, (3) maintain to prevent and (4) repair to cure.
1. Choose to last
Favour a manufacturer that promises a long support: software updates and spare parts stock. A warranty of more than two years is a good point too. The Crosscall CORE-M5 has a 3 year warranty and spare parts available for 10 years for example. Otherwise, there are warranty extensions or insurances that can be concluded at the moment of purchase (on Digitec for example). It can be interesting for your most important devices.
Pick a reparable product: if parts are easily accessible and are assembled without anything or with screws, the repairability will be better. If parts are difficult to reach (proximity, on top of each other) and are assembled with glue, or worse, with solder, the repair will be complicated. The iFixit website and the french Spareka Repairability Score website are are good starting points to find information. In general, fixed computers are made to be easily repaired, except a few special or very compact models. For mobile devices, it is often more complicated. Fairphone are easily repairable smartphones (see the Digiene review). But Spareka ranks them neck and neck with several Crosscall models. On iFixit, HP is regularly at the top of the ranking for the tablet and laptop categories.
Choose a good ruggedness, especially for mobile devices (smartphone, tablet, laptop): many products are waterproof and dustproof (IPXX, IP68 is a minimum), some fare well against shocks, vibrations, extreme temparatures and other elements (MIL-STD-810). Resistance against electromagnetism is unfortunately still rare. The Cat S62 Pro and the Crosscall CORE-M5 are both IP68 and MIL-STD-810.
2. Use without damaging
On the hardware side, a fixed device (tower for example) has at least to be safe from dust and liquids (avoid the ground), not be subject to shocks and vibrations and have space to dissipate its heat. It is better to avoid stacking sheets, folders and other documents on or next to the PC.
A mobile device that is rugged is the easiest. Otherwise, a protection case is recommended for everyday use. Certain popular brands have a large choice specific cases for each model (Apple IPhone for example). For the others, there are general cases (Reboon for example). During certain activities (beach for example), accessories such as the Cellularline Voyager or the Exped Zip Seal can avoid an accident.
On the software side, it is better to install only reliable and really necessary applications. Regular backups on different types of storage devices is recommended. Here, having a good digital hygiene is particularly important: bad habits can lead to very unpleasant consequences (virus, loss of data). If needed, Digiene offers coaching, consulting or lessons.
3. Maintain to prevent
On the hardware side, fixed devices need to be cleaned periodically to remove dust, including inside. Indeed, they are cooled by a fan in most cases. The DataVac Electric Duster ED-500 or a one-time gas duster (compressed canned air) can come in handy. Warning, some parts can be damaged easily (water, static electricity, etc). Sometimes, the warranty can be voided too if you open the case yourself. In doubt, it is better to call in a specialist.
Aside from laptops, most mobile devices are cooled passively. Therefore, it is often not necessary to clean them from the inside.
On the software side, installing a well-known security software from the start is an good idea (Norton, McAfee, F-Secure, etc). It is essential to update all the software regularly: the operating software (OS) and all the applications. If necessary, Digiene can help you with coaching or lessons.
4. Repair to cure
In case of a hardware or a software problem, a repair is often possible. There are many service providers available that the Romand Consumers Federation (FRC) has compiled on an interactive map that should be updated soon, according to the FRC. It is also possible to make repairs yourself, thanks to tutorials on website like iFixit or Spareka. iFixit sells good IT repair kits and toolboxes as well. But as with maintenance, watch out for fragile parts and beware of the warranty that can be voided. In doubt, it is better to call in a specialist.
And even if a product is declared end-of-support by the manufacturer, you can give it a second life. For many devices, it is the operating system (0S) that is not updated anymore. Then, there are free alternatives that can prolong the life of your devices: wether it is a computer (Fedora, Ubuntu, etc), wether it is a smartphone (LineageOS, /e/ OS, etc) or an other device. These replacement operation systems can be more or less different from the original: a small effort to adapt is therefore necessary. Finally, it is often not a company that sells you the alternative software: in general, it is a community of volunteers that develops it and makes it available freely in a spirit of mutual aid.