The best practice is to plug into power whenever it’s convenient and run on battery only when you cannot connect to power. Your Mac uses Optimized Battery Charging, which is enabled by default. That is designed to charge the battery in a way that balances increased battery lifespan with your personal usage patterns.
About battery health management in Mac notebooks - Apple Support
To confirm that Optimized Battery Charging is enabled, go to System Settings > Battery then click the (i) to the right of Battery Health.

If your Mac is usually plugged in, macOS will pause charging at 80% full since that’s better for the battery long term. If you frequently run on battery, macOS will charge the battery to 100%. That behavior will change depending on your usage. For example, I use my work MacBook Pro connected to a dock for most of the week, and charging pauses at 80%. If I run on battery a few hours for a couple of days, it will start charging to 100%. If I then keep the Mac plugged in for a couple of days, it will again pause at 80%. When your Mac decides to hold the battery at 80% charge, it will bring it to that level even if the battery is fully charged and the Mac is connected to power, which is what one of my Macs did here:

If charging is paused, you can override that by clicking on the Battery icon in the Menu Bar or Control Center (you may need to enable that in System Settings > Menu Bar) and select Charge to Full Now.
Once ‘trained’ the system is pretty responsive. For example, when my Mac was holding at 80%, a couple of short (30-45 minute) sessions running on battery one morning was sufficient to have macOS decide it was time to bring the battery to a full charge.

The bottom line is that your Mac will manage its battery charging to preserve the health of the battery while supporting your usage patterns. There's no need to micromanage it, let macOS handle it.
I typically use my personal Mac, a 16" M4 Pro MBP, connected to a dock, with very occasional use elsewhere in the house for a few minutes or a couple of hours. The Mac is 11 months old, has 14 cycles on the battery and the battery health is 102%. I typically use my work Mac, a 16" M1 Pro MBP, connected to power but 1-2 days a week I will run for a couple of hours on battery, and 1-2 times per year I will use it mostly on battery for a few days (scientific conferences). That Mac is 3.5 years old, has 196 cycles on the battery and the battery health is 93%.
I've used Mac laptops since the PowerBook days, my experience has been that health drops from ~100% (my new Macs have mainly ranged from 98-104%, I did have one that started at 112%) to somewhere in the 88-93% range over the first 100-200 cycles (or 2-3 years, whichever comes first), then stay in that range for several hundred more cycles (or 3-4 years, whichever comes first) until they begin their inevitable decline at (with more recent Macs) between 800-1000 total cycles (or 7-8 total years, whichever comes first).
Note that there is both a usage and an absolute time component to battery longevity, even with very little actual use a battery has a finite lifespan, that's down to the chemistry in the battery that stores the power.