Via the Finder menu bar, there is a Force Quit option.
At the Finder menu bar, go to the Apple logo and select Force Quit or keyboard command - Command
OptionEscape.
This brings up a window with all running applications with an indication next to the application or applications not responding. You can select a non-responding application and then Force Quit.
Your Mac should not be locking up every few days. As a first step, check
Resolving Disk, Permission, and Cache Corruption for system troubleshooting procedures and when doing so, follow all steps/instructions in the order provided.