How to get rid of the notification bar glitch on the iPhone 4s if your lock button is broken?
You can use Assistive Touch to mimic the broken button.

Once you enable it (in Settings -> General -> Accessibility -> Assistive Touch), to turn the phone off, you would activate the assistive touch menu, press "Device", and then press and hold "Lock Screen". 

To turn the phone back on, plug it in to a power source (battery, wall socket, or computer).