The following article discusses some 'do's' and 'don'ts' of charging your phone's battery. By and large, don't worry about it too much is the gist of the article, with a few caveats. My iPhone X, for example, is fairly old, and the battery seems to be holding up just fine. I usually just charge it an hour or so in the morning, till it is fully charged. Charging Your Phone Overnight: Battery Myths Debunked | PCMag
MacOS, on the other hand, has the charging of Mac laptop batteries set to only 80% of full charge, then it stops charging the battery. The intent is to prolong battery life. This feature can be overridden and go to a full charge, but I usually don't full-charge.
Jim Hamm