Not too sure what you're asking here...
You can get a text editor like Notepad++, Sublime etc. and write code there. Then you save it with the extension,
.html. The same you would do saving a Word document where you can Save your stuff and call it anything you want (and it saves with the extension,
You don't have to always name your HTML files
index.html but it's best to when it is about a main page.