Visual Studio Code is a free code editor with excellent JavaScript support. Download it from code.visualstudio.com and install it.
Once installed, create a new folder for your project and open it in VS Code (File > Open Folder). Create files: index.html for your webpage and script.js for your JavaScript. VS Code provides syntax highlighting, error detection, and autocomplete as you type.