You can use WPCode’s library to access over 900 code snippets that you can add to your website easily.
However, if you are not using WPCode, then you can also get prewritten code snippets from websites like Stack Overflow, CodePen, or GenerateWP.