Re: my phone wont stay locked and its draining my battery.
Welcome to Android Central! Which phone? Does it have a case? Some cases with a smartcover can cause the screen to mistakenly lock and then awaken if the cover is folded back behind the phone. If the magnet in the cover isn't well-calibrated, it might hover between turning the screen off and then waking it again.
You could also boot into Safe Mode to see if it's a 3rd party app that is causing the problem. On most Android devices, while powered on, press and hold Power until the Power Off menu appears. Press and hold the Power Off selection until the Safe Mode prompt appears. Tap OK.
If the problem disappears in Safe Mode, then something you installed is causing the problem. You may have to uninstall apps one by one until the problem disappears. If the problem persists in Safe Mode, then it's more likely to be a hardware or firmware problem.