Heat is a battery’s biggest enemy. Don’t leave your phone in a hot car or in direct sun, and take it out of a thick case while it fast-charges. Use a good-quality charger and cable, because cheap ones charge unevenly and can damage the battery over time.
You don’t need to drain your phone to zero. Lithium batteries last longest when kept roughly between 20% and 80%, and most phones have an optimised charging setting that helps with this overnight. Day to day, lower your screen brightness, turn off background refresh for apps you rarely use, and keep your software updated, since updates often improve battery efficiency.