How to import one vanilla JS file in another vanilla JS file?

I am implemanting my assignment in Vanilla JavaScript but my code is too lengthy. So, I want to devide my js file into two differnent files and import one file into another file.

Is it possible?? How it will work with html file?

I have tried type=”module” but it is not working when I open HTML file direct in browser.