Running in the background of Android Marshmallow is Doze mode, a system that ensures your phone or tablet has a good rest while not in use. You don’t need to do anything to activate Doze, other than upgrade to Android 6.0 on your device.
Basically, all you have to do is leave your phone alone. Doze won’t work in your pocket thanks to the motion sensors detecting movement. If items are moving across the phone’s front camera or light sensor, movement will be detected causing Doze not to activate.
Instead, your phone needs to be kept still. Just put it down on a desk or shelf with the display off. Only phone calls, SMS messages and anything else classed as high priority will be received and Android will consume minimal battery. It’s as easy as that.