Here's even a better idea: have a setting like Samsung's "Sleep time protection" where it'll charge it to only 80% or so when you plug it in at night and then finish charging to 100% before you wake up.
This settings have been available on the Galaxy S like since the S20 or earlier.
That's the "Adaptive Charging" setting above the 80% setting in the screenshot. Of course, that depends on predicting when "you normally unplug"...
iOS has the same for years ago too, even before it introduced the 80% limit. It's arguably less useful because it requires you to meet specific conditions to trigger, unlike a straightforward limit.