There are so many myths and opinions about this question, and it seems like everyone has their own different anecdotal data points.
Me personally? I almost always keep my laptops plugged in, but occasionally I do want to run off battery power (say, at least once every 2-4 weeks) and run it at least to below 50%, maybe a little more (like 30-40%), then I plug it in again.
I don't claim this is categorically the "right answer" but especially in recent years with Li-Ion battery technology, it has served me pretty well. The old ideas about needing to sometimes "calibrate" batteries with a deep discharge cycle no longer seem to matter, and in fact in my *own* anecdotal experience (a couple of data points) doing so seems to be rough on the battery.
Sometimes I've had a situation where I leave an old, idle spare laptop unplugged for a long, long time. The battery goes to zero, remains at zero for weeks or months, and can't be jumpstarted; a previously "perfectly good" battery which had almost all of its original capacity remaining became a brick. These days I make sure to either keep them plugged in or disconnect the battery from the laptop (for models which have removable batteries).