Apple took this out of Mac OS somewhat recently. You can try to rely on their power management, but given battery decay is a common reason to buy a new machine I don’t trust them really.
If you have an Apple Silicon Mac I can recommend Battery [1]. It can keep your Mac at 80%, and even force discharge while plugged in to get there. It’s a CLI and status bar utility, I love it.