For example, to set a shortcut for a TextEdit command, choose TextEdit. If an app isn’t in the list, choose Other, then locate the app using the Open dialog. Some apps may not allow you to set keyboard shortcuts.
If you want to set a shortcut for a menu command that appears in many apps, choose All Applications.
In the “Menu title” field, type the menu command for which you want to create a shortcut, exactly as the command appears in the app, including the > character (type ->), ellipses (type three periods without spaces), or other punctuation.
For example, to set a shortcut for the default ligature command in TextEdit (Format > Font > Ligatures > Use Default), type Format->Font->Ligatures->Use Default in the “Menu title” field. To set a shortcut for the Export as PDF command (File > Export as PDF…), type File->Export as PDF… in the field.
Click in the “Keyboard shortcut” field, press the key combination that you want to use as the keyboard shortcut, then click Done.
For example, press the Control, Option, and Z keys at the same time. You can use a key only once in a key combination.
You can create keyboard shortcuts only for existing menu commands. You can’t create keyboard shortcuts for general purpose tasks, such as opening an app.
If you create a keyboard shortcut that already exists for another command or another app, your new shortcut won’t work—you need to change your new shortcut or the other shortcut. To change a shortcut, select it, click the key combination, then press a new key combination. See Apple Support article: Use the function keys on MacBook Pro with Touch Bar