If your MacBook Pro gets locked frequently, the immediate help would be to run a force restart or hard reset. Here’s how it works:
Press and hold Command + Control + Power button
Release the keys once the Mac restarts
Sign back into your account.