If you are tech blogger, syntax highlighter is a must have for your WordPress blog.
The best way to have syntax highlighter for your WordPress blog is using a plugin. There are frameworks like prismjs which you can use for highlighting code. You can follow this tutorial for that. However, you need to have a good understanding of WordPress backend framework to incorporate prismjs in your blog.
As we mentioned earlier the best way to setup syntax highlighter is using a plugin.
Once installed, you will get an option <> in your post editor. You can add your code to that block as shown below.