Today I learned about Visual Studio Code Snippets, these are code templates that save you the time wasted writing repeating code.
To create your own code snippets, select File > Preferences > User Snippets
and then select the language you want to create snippets for.
You can use the Snippet Generator extension, or this snippet generator webapp (my personal pereference) to help you create the snippets JSON file.
This is a list of snippets that I created for Python 🐍.