Charge your iPhone while you sleep as most of us do.
Maybe charge at other times, if you’re making particularly heavy use, and if the charge gets too low for your immediate needs; prior to your while-sleeping charge cycle.
If you get down to 10% or whatever low remaining charge percentage, your iPhone can and will work fine, you will simply have less margin for a longer telephone call or marginal cellular signals or such; for when you might need to use your iPhone.
If you get down below 80% on battery health, then you may or will want to look at battery service.
All batteries inevitably and inexorably degrade, always have, always will.
See the following link for how to manage the health and longevity of the battery:
Batteries - Maximizing Performance - Apple
If the iPhone battery health percentage does get too low for your usage (80% or lower), the battery can be replaced.