Ever find yourself mindlessly flipping through apps on your phone when you really should be sleeping?

It’s not just a bad habit — research has shown that the blue light wavelength emitted by various gadgets, including your smartphone and tablet, actually suppresses melatonin, which is the hormone that keeps you in a normal sleep cycle.

That bright shining screen is actually messing with your body’s built-in clock, keeping your brain alert when it should be resting and recovering.

To fix it, your best bet is to put your phone down entirely, but if you just can’t ditch your iPhone or Android device when the sun sets, you should at least be using these built-in features to keep your sleep cycle in check.

iOS – Night Shift

Night Shift is a feature built into iOS on iPhone and iPad that automatically shifts the hue of your screen to warmer colors at night.

By minimising the blue light from the screen, Night Shift can dramatically preserve your sleep cycle by allowing your brain to tell you when it’s time to hit the hay. Here’s how to turn it on.

Go to your Settings menu and select “Display & Brightness” and then “Night Shift.”

Here you can schedule the times when Night Shift will turn on, or just enable it by making sure the “Scheduled” tab is switched on and allow your phone’s own built-in sunrise and sunset data to control when Night Shift starts and stops.

If you ever need to pause Night Shift for any reason, you can swipe up from the bottom of the touchscreen to bring up the Control Centre and then tap the Night Shift button.

Android – Twilight

The latest version of Android — 7.0, or “Nougat” — has disabled the operating system’s Night Mode for some odd reason.

There’s a long, complicated trick to turning it back on, but if you want the features of iOS’ Night Shift on your Android phone without the hassle, you can install a free app called Twilight.

Twilight works exactly the same way as Night Shift, by muting the blue light emitted by your smartphone screen based on the time of day.

It uses your GPS and time data to sync the screen brightness and color shift with the sunrise and sunset, and it’s totally free.

Just download and install it on your Android device, open the app and approve the permissions.

It will automatically be set to a reasonable color and dimming setting, but you can tweak those options with handy sliders on the app’s settings screen, too.

Use Night Mode

Many apps, including Twitter, WhatsApp, and even Google Maps have their own “night mode” that you can enable in their individual app settings menus.

These modes replace the bright white colors with darker grays and blacks, making your screen much easier on the eyes in a dark environment.

Not every app has a night mode, but be sure to check the settings menu of your favorite ones to see, because it can be a real eye saver.