Why it stops working
Apple's own guide puts it plainly: "Text replacements, smart quotes and dashes, and smart links aren't available in all apps." macOS doesn't expand the shortcut by itself; the app you're typing in has to support the feature. That's why the same shortcut can work in Notes and do nothing in another editor or a web form. The other usual causes are the feature being turned off in that app, and a shortcut that doesn't match what you type.
1. Check the app you're typing in
Click into a text field in the app, then open its Edit menu and look for Substitutions. Choose Edit > Substitutions > Show Substitutions and make sure Text Replacement is turned on.
- No Substitutions menu at all: the app doesn't offer macOS text replacement. No setting will fix that; see the fallback below.
- Text Replacement was off: turn it on and try again. The setting can differ from app to app.
The same panel can also apply your replacements to text that's already written: select it and click Replace in Selection, or Replace All.
2. Check the entry itself
Choose Apple menu > System Settings, click Keyboard, then Text Replacements. Find the entry and compare it with what you type:
- The shortcut must match exactly. A stray space at the end of the shortcut is easy to miss.
- Type the shortcut as its own word, then a space or punctuation. A shortcut typed in the middle of another word won't expand.
- Pick shortcuts that aren't real words (
;sig, notsig), so they don't collide with normal typing.
3. Test in TextEdit
Open TextEdit, make a new document and type the shortcut followed by a space. If it expands there, the entry is fine and the problem is the other app. If it doesn't, recheck the entry and the Text Replacement setting in TextEdit's own Edit > Substitutions menu.
4. Missing on another Mac or device?
Apple says you can keep text replacements up to date on all your Apple devices, and points to its "Back up and share text replacements" page for how. If an entry exists on one Mac and not another, follow that page rather than re-creating entries by hand.
When the app doesn't support it: paste instead
Every app that accepts text accepts a paste. That's the idea behind a clipboard snippet app: instead of typing a code and hoping the app expands it, you pick the text and paste it.
Refrain does this from the menu bar. Press Control-Option-Space in any app, type a few letters of the snippet's name or of any phrase inside it, press Return, then Cmd-V. There are no codes to remember, long text keeps its line breaks, and it doesn't need Accessibility permission because it never watches what you type. Your snippets sit in one markdown file you can open in any editor.
Many people use both: Text Replacement for a few short codes in apps that support it, and Refrain for longer text and everything else. The full comparison covers where each one is the better fit.