Chosen Solution

When pressing a home or power button, the phone illuminates the “menu” and “back” buttons, then after a few seconds the screen shows up for less than a second, then goes black again. After 3-5 tries, I may get lucky and the screen finally turns on so I can unlock the phone and use it. Are there any solutions before I try factory reset?

There are some step to reset your phone in safe mode press the power key and hold for like 20 sec . now tap the power off option . just press the power key and hold if for more than 1 min keep holding it . it may ask you to confirm the safe mode please confirm it and wait for 1 min . And second method is - To Boot android phone in safe mode you can also try Volume Up + Volume Down + Power without doing reboot on your phone . this may take you to recovery options also be care full here you don’t want to end up resetting your phone and losing you settings and data. Note- But I think Your phone is just a hanging problem because of some virus so after reset update new antivirus.