Sometimes your Lock/Power button can be jammed due to excessive usage. Regardless if it can be repaired, you may want an option to immediately lock your phone even if your button does not work.
Rest assured, you can simply use Assistive Touch in order to access your Lock button feature.
How to activate Assistive Touch
Access General Settings. Choose Accessibility. Turn it on. Hit the circle button pop-up. Choose Lock
Hit Power Off in order to lock your phone without using the physical button