When an app freezes, reaching the Apple menu is not always easy. The keyboard has a way in that does not depend on the frozen app.
Press Option-Command-Esc. Apple’s list of Mac keyboard shortcuts describes it as the way to force quit an app. A window with your open apps appears. Select the one that does not respond and click Force Quit.
The same list has the gentler options. Command-Q quits the current app, Command-H hides its windows, and Command-W closes the front window. I try Command-Q first. Force Quit is for the moment that Command-Q does nothing.
A beachball does not always mean the app is stuck for good, so I give it a minute before reaching for the shortcut.
The caveat is that Force Quit ends the app immediately. It skips the normal quit, so anything unsaved in that app can be lost. Some apps keep an auto-saved version, but I would not count on it. If a file in that app mattered, open it again afterwards and check that it is intact.
Further reading: Mac keyboard shortcuts