Hi there and welcome
Can you remove the power cable please and then hold the power button in for 60 seconds then release.
Then connect the power and tell me if it now operates correctly please.
Go to System Preferences / Security & Privacy / General tab select the lock at the bottom and enter your password ***** go to Advanced make sure Log out after ?? Minutes of Inactivity is not checked.