Let the battery cool after a hard ride before charging, use the correct charger, keep electrical connectors clean and dry, and avoid long-term storage at a completely empty charge level.
Storage matters
For extended storage, follow the manual for your specific battery and check its charge periodically. Protect the pack from extreme heat, freezing conditions and water ingress. Never pressure-wash around electrical components.