Correct way to use my new laptop - on battery or on charge?

I have recently purchased a Lenovo laptop for work. It runs around 1.5 hrs without charging. Please suggest the correct way to use the laptop so that it lasts for years. Should I keep it charging all the time I work, or let the battery drain to around 30%, then charge again?
I have read people suggest 'Every time you charge your battery, the total capacity of the battery is diminished' - is that true?

Please help me. This is the first time I'm using a laptop.

Look at you energysettings in windows. And close the programs that run in the background.

^^ my question is, the best way to use the laptop! Please read again.