Avoid high temperatures:
Iphone heats terribly fast. Using it under direct sun heats it up, and damages the battery cells.
Don’t let it discharge below 20%:
Lithium ion batteries are built to last only if they’re taken good care of. The worse you can do to the battery is making it to complete 0% before charging again.
Avoid unofficial chargers:
Unofficial chargers can produce more heat or might not communicate well with the battery management controller, and cause excess heat which will damage battery life.
Avoid case that won’t dissipate heat when charging:
As said above, heat is one of the worst enemies of Lithium batteries. Some cases are built without considering this into factor. Battery heats up when charging, and when that heat cannot vent out, it damages battery over time.
And finally, keeping it (iPhone) charged overnight does not affect battery health at all unless you’re using a faulty wire or charger which is heating up unnecessarily. iPhone won’t charge over 100% even when connected.