Q: How do you remove malware from a MacBook that locks you out?
Much depends on what security precautions/protocols have been put in place on your Mac.
If you have (another) administrator account, that user can log in, go to System Preferences > Users & Groups, and reset your password.
If you don’t FileVault2 active, you can boot into Single-User Mode, remove the /private/var/db/.AppleSetupDone file, reboot, create a new admin account at the prompt, login with the admin account, then change your password. (I have not included the actual step-by-step because if you don’t already know them, have a pro do this for you).