Macs have a built-in password reset tool available in recovery mode.
You’ll need to restart your Mac by clicking the Apple menu and selecting Restart. Press and hold the Command+R keys as the computer boots and it will boot into recovery mode.
Select Terminal, type
resetpassword into the terminal, and press Enter.