macOS can assign a keyboard shortcut to an existing app menu command. It is useful for an action you repeat often that already appears in the menu but has no convenient combination.
Start with a real menu item
Open the target app and find the command. Record its exact wording, including punctuation and any ellipsis. App Shortcuts matches a menu command; it does not turn any arbitrary button on a webpage into a system command.
Open System Settings › Keyboard › Keyboard Shortcuts › App Shortcuts. Add a shortcut, choose the specific app and enter its menu title and key combination.
Test in the same context
Return to the app, reopen the menu and inspect the command. Test on a harmless document. Some commands appear only with a selection or a particular window open, so a greyed-out command may be unavailable rather than incorrectly configured.
Choose a combination that does not replace an action you already depend on. Restricting it to one app is easier to reason about than assigning it across every application.
Maintain the shortcut
If an app update renames the menu item, the matching title may need updating. Remove the entry from App Shortcuts when you no longer use it.
TapNoise’s shortcut sheet can help you inspect the current app’s menu commands. If a combination works unpredictably, use the conflict checklist before adding another mapping layer.
Source: Apple: use macOS keyboard shortcuts.
TapNoise