Use the Settings button and go to the JS tab. Now search for and add the library.
If you use “Add External Scripts/Pens” it is added as a script and you have to use the .parse() method.
If you add it as a module import you can use either marked() or marked.parse()
I will say the import on Codepen from skypack.dev is often broken so use esm.sh instead if you want it as a module.
import { marked } from "https://esm.sh/marked";
console.log(marked(`# test`))
You have a bunch of undeclared identifiers in your code, that won’t fly when using modules, and isn’t something you want anyway. Declare your variables.