First, go to hightlightjs.org to get the latest version of package or if you want to make your own custom package with custom code. Then, take example of following code to link the files and initiate hightlightjs. (Add these code between <head> </head> tags)

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/styles/default.min.css">

<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/highlight.min.js"></script>

Then, add the script after tag.

<script>hljs.highlightAll();</script>

After doing this, 90% of your work is done, now you just need to make the script know which part must be highlighted. Use the following example code if you want bash code to be highlighted:

<pre><code class="bash"> ... </code> </pre>

You can similarly replace the class for different programming languages, Eg: To highlight JavaScript, we add same code, instead of bash class, we add javascript.

If for some reason, it is not highlighting, then either you didn't implement the code properly or not all of code can be highlighted, or you haven't added the coding language into the package.

For documentation, visit this page.

For packages, visit this page.