Laptop battery care tips

I was hoping someone could give me advice on keeping a laptop battery in good condition. I recently replaced my laptop battery (lithium ion) and I’d like to keep this one holding a charge, since the last one lost its charge in only around 6 months. How do I do this? I’ve heard so many contradicting advice, from “keep it fully charged as much as possible” to “constantly expend it totally and then recharge it again”. What’s the right way to make sure the damn battery lasts at least a year this time?