The Heat Factor
Batteries hate two things: Heat and High Voltage. Running your Mac at 100% charge while plugged in all day is a recipe for a swollen battery.
Optimized Charging
Always keep "Optimized Battery Charging" enabled in System Settings. This allows macOS to learn your routine and keep the battery at 80% until you actually need it.
The Sweet Spot
Lithium batteries are happiest between 20% and 80%. Try not to let your Mac drop to 0% frequently, as deep discharges damage the cells' chemistry.