Text expanders are good for this. You can have it as basic as "ty > thank you" up to templates which will ask for input, optional sections in templates, templates in templates, running scripts, and so on.
Very useful in eg. customer service when you want to reply to someone with links and whatnot. Giving instructions, etc.
For programming you can build up a library of common things, think ";;p -> print("\($place_cursor_here)"). Or whole classes, anything you can think of, really.