While building your project, you must choose the platform to be WebGL. If you're using Unity you just need to download the addon from Unity Hub then select it from build settings. Youtube videos will go on more detail, so I recommend you to research "How to build WebGL game on [game engine you're using], and then "How to punlish WebGL game on itch.io"