This is a guide to a longer lasting Android device, from choosing one to how to preserve the life of the one that you have.
Choosing a long-lasting and repair friendly phone:
To get the best shot at longevity, start with a high quality device from a manufacture with a history of long term device support, and one that regularly releases there modifications to the kernel source code. A device that has an unlockable bootloader (XDA developers Forums is a good place to see about ROM support), and is user repairable (See iFixit's Smartphone Repairability Scores) will allow you to keep the software & hardware going the longest. Both the Google Pixels, and Fairphone's line are a good place to start.
Apply a liquid “screen protector” then a screen protector on top, Sapphire being the best (but very expensive).
Battery
Lithium-ion (LI-on) battery's wear out faster when near the upper and lower charge levels (read why here: Battery University, so avoid charging or discarding the battery fully, aiming for around 20~80% is a good target.
Charging
Avoid fast & wireless charging. (to reduce the heat the battery endures)
Use a magnetic charging cable to reduce the wear on the plug (Like Volta), you need a bulky case to have it flush to not make the phone uncomfortable to hold though.
When/If you use a regular charging cable don't move the phone when it's plugged in, movement wears the plug much sooner.
Use a charge limiting feature. (Listed in order of recommendation.)
If your phone has a built Smart battery charge management feature, use that.
If you have Root use ACCA(a GUI for ACC) (recommended, automatic)
Buy a cut off switch, like a Chargie by Lighty Electronics that's has an app to auto cut off power based on power draw or charge level. Note that in The newest Android versions restricts the APP from auto enabling Bluetooth, making this a bit of a meh solution. Using an Automation APP like Tasker to turn off a Home Assistant-controlled smart plug when the battery exceeds a reprogramming threshold might be a more reliable method.