What Zelig said. The thing I see people doing most often that kills lithium-ion batteries is leaving laptops plugged in long term. If you're going to have the laptop stationary and plugged in for more than 6-8 hours, pop the battery out until you actually need it again.
One thing you can also do with a new battery is condition it. Let it fully charge (overnight), then run it down pretty low (10-15%, but *not* completely dead). Then let it fully charge again... drain again... rinse & repeat 3-5 times. How much it really helps I can't say, but that's what you're "supposed" to do, and I don't think it can hurt.
Realize too though the lithium-ion batteries just don't last forever. They literally start to degrade teh moment they're assembled in the factory. I would say if the battery makes it 2-3 years and is still maintains a "good" charge, you're well above the curve.
Edit: And when you buy a battery, I would get it direct from the manufacturer if possible, because you want the battery to be as new as possible. At a retail store, it's not unlikely that the battery you buy has been sitting on the shelf for 3-6 months or even longer.