I had a totally outdated and probably insecure Samsung S6 edge 2 years ago that started rebooting randomly. I think that prior to that it was so old I could only install stuff from f-droid and aurora because roots certs installed on that old android version were too old for playstore to work. Too bad as you can't easily find smartphones in similar sizes anymore.
Knocking on wood my pixel 6a still going strong after 2 years.
Did that for 20 € for my Oppo Find X3 Pro at my closest tech store and saved me from buying a brand new phone
I know many people who had their old phones and computers lying around because they didn't invest the time to transfer the data. Not long after, the phone was unusable either due to hardware problems or forgotten passwords, and the data is lost forever.
I got a Sony Xperia Compact from maybe 2016. I use it as a bicycle navigator / recorder. Recently it stopped reading SIMs, probably rusty contacts, but all I need is wifi to update OSMAnd and send me the tracks I recorded.
I also have a very old tablet, maybe 2014. My SO uses it to view movies with VLC and TV via TVHeadend.