Simple habits avoid most repairs.
1. Use a good case and a tempered glass protector.
2. Don't charge under pillows or in the sun.
3. Use good chargers and cables.
4. Keep the phone away from water, steam and sweat.
5. Keep it in its own pocket, away from keys and coins.
6. Don't use it while it charges in bed.
7. Clean the charging port and speaker grilles gently every few months.
8. Back up photos regularly.
A phone treated well can easily last three or four years.