For example, I only buy/use old high-end (for their day) business class laptops and put linux on them. They work for everything I need to write and surf.
I also bought an iPhone that was already a few years old and plan to keep it until it stops getting security updates from Apple. I also moved from Android to Apple not because I like iPhones better (I don’t, really), but because the years of security updates (versus maybe one or two, on Android) matters to me.
And if you do need something that runs on batteries (like a flashlight) try to get one that uses 18650 lithium batteries. 18650s were/are used in laptop packs and a ton of other things so they are very easy to find and last for years even used. One old laptop pack can provide 3-9 cells. Just be sure not to use damaged ones.