As Allendar's comment said, read the documentation and help. I suspect it will say something along the lines that you should connect the charger whenever power is available, and avoid a deep discharge. These days I suspect the software will protect you as well.
By deep discharge I mean to keep running the computer from battery power beyond the limit recommended for best battery life.
Get the computer to show the battery status in the menu bar, keep an eye on it, and act accordingly. Especially if it says the battery needs to be serviced - when this happens, get the computer looked at as soon as you can.
I have a 2009 MacBook I am still using, and the biggest problem I ever had with it was when its first battery started to fail. The computer warned me about it (via the status in the menu bar) but I, wanting to save money, ignored the warnings. Eventually the battery truly failed, swelling up and causing hardware trouble.