We’re all at the mercy of the battery packs inside our smartphones and laptops. Once these batteries die, our lives get put on hold until we can find somewhere to plug in again. It’s no wonder battery life estimates are one of the first specs many of us look for when choosing a new device.

But with the right operating system tweaks and customizations, plus some good habits, you can go longer than ever without being shackled to a wall outlet. After all, you don’t want to spend all day worrying about when you’ll be able to charge your laptop.

Adjust your screen settings

One of the biggest draws on your laptop’s battery is its bright, high-resolution display. Anything you do to ease that strain will have a beneficial effect on the length of your battery’s life.

Start with brightness: Dial down the brightness of the screen as much as you can without having to strain your eyes, using whatever keyboard shortcuts your laptop offers. You can make more detailed modifications by opening up System, then Display in Windows’ settings or Displays in System Preferences on macOS.

Screens that time out sooner also use less battery. To set this and a bunch of other power-saving options, choose Power & sleep inside the System section of Settings on Windows, or Energy Saver from System Preferences on macOS.

Other settings available on the same screens let you put your hard drives to “sleep” (they’ll take longer to wake back up, but they’ll use less power), put USB devices into a low power mode, and more. These tweaks won’t make major differences, but you can eke out some extra battery life by enabling them.

If you’re on Windows, there’s a special battery-saver mode that maximizes the time you’ll get between battery charges. It limits background activity and notifications and automatically adjusts the display brightness once your battery level dips below a certain point. To find this utility, click the battery icon on the taskbar, then Battery settings.

There’s no battery-saver mode on macOS, but it is rolling out a battery health setting in macOS Catalina 10.15.5, which you might have by the time you’re reading this. It’s enabled by default and extends your laptop’s overall lifespan by occasionally reducing its maximum charge. You can manage it manually, though, by opening Energy Saver from System Preferences and clicking on Battery Health.

Both Windows and macOS now feature a dark mode, which can reduce power draw too, but only on laptops with OLED screens (an LCD screen draws the same amount of power to show black as it does white). While many phones have OLED screens, only a few Windows laptops do. If you have one, the dark mode option is under Personalization and Colors in the Windows Settings dialog box.

Reduce your laptop’s workload

The harder your laptop is working, the faster it’ll drain your battery. That’s why, when you’re away from a power source, you should close any programs hanging around in the background that you’re not actually using. If your computer runs fewer applications and avoids demanding programs (such as games and video editors), its battery should last longer.

Even if you close everything you’re not using, the browser is a bigger battery suck than you might think. Resist the temptation to have dozens of browser tabs open at once, and your laptop’s battery will thank you. And when you’re browsing, avoid video streaming sites. They typically demand a lot of battery, both because they keep the screen constantly active and because they require a decent amount of processing power.

Audio makes a difference too. Active speakers blaring out music will use up more battery power than silence—or a pair of plugged-in headphones. If you can, turn down the volume or do without sound altogether.

Maintaining Wi-Fi and Bluetooth connections also uses up battery power, albeit a pretty small amount. If you can disconnect your laptop and work offline—and do without a wireless mouse and other peripherals—you’ll get a little bit more battery life as a result. We’re not talking major improvements, but you might just make it to the end of the day.

Keep that battery healthy

Lithium-ion batteries degrade naturally over time, but if you treat your laptop battery right, you’ll enjoy better battery life for longer. Avoiding environments that are too hot or too cold is a good start, as temperature extremes will wear batteries down more quickly.

It’s not just the weather, either—running demanding applications on your computer can generate the heat your battery needs to avoid. This brings us back to the idea of sticking to lightweight tasks and programs while you’re away from a power source. If you really have to have a gaming session or encode some video, consider using a laptop cooler to dissipate heat more effectively, keeping your laptop battery running longer.

There’s an ongoing debate within tech circles over the “healthiest” approach to recharging batteries. The most up-to-date advice suggests that shallow discharges and recharges are preferable in the long-term, rather than allowing your battery to drain completely each time—though you should still do a full discharge about once a month. Unplugging your laptop once it’s fully charged, rather than leaving it always plugged in, tends to be better for your battery’s health as well.

Finally, if you won’t be using your laptop for a while, Apple and others recommend leaving the battery with a 50 percent charge in it—leaving it fully charged or fully discharged for an extended period of time can damage it permanently.