What wears down a battery? Charging and discharging. Obviously, you can’t avoid either of those acts entirely (although if you could, you wouldn’t have to worry about wearing out your battery). The trick, of course, is to do as little charging and discharging as possible. And one way to avoid charging and discharging is to remove the battery when you don’t need it.
Ideally, you would remove the battery (with the laptop shut down, of course) before plugging in the AC adapter and working at your desk. Then, before you take your PC on the road, you would shut it down, insert the battery, and let it charge for a few hours.
In reality, that’s not always practical. Shutting down and rebooting your PC every time you go from portable to deskbound quickly becomes a nuisance. Worse, you have to remember to recharge before leaving home.
A more practical solution would be to shut down the laptop and remove the battery when you expect it will stay plugged in for a week or more. And don’t intentionally discharge the battery before removing it. After all, the whole point is to charge and recharge as little as possible.
Some of the charge will be lost while the battery sits unused, so it’s still a good idea to recharge it before taking it on the road – even though that requires some planning ahead of time.