Environment setup
Install the Salesforce CLI and the Salesforce Extension Pack, then run sf org login web on a Developer Edition org or a scratch org.
Editor and CLI
Install the Salesforce CLI, the sf command, and Visual Studio Code. Then install the Salesforce Extension Pack. The pack adds deploy, retrieve, and the org commands inside the editor.
Salesforce also ships a browser IDE you can launch from an org. Use that when you do not want a local editor. Local work still starts with the CLI and the extension pack.
Log in
In a terminal, run sf org login web. A browser opens. Sign in and allow access. Add --alias so later commands can name the org, and --set-default when this org should be the default.
Use a free Developer Edition org when you want to keep the component. ApexSensei lists that signup on the developer orgs page. A scratch org is a short-lived org you create from a Dev Hub. The CLI reference documents that command.
The component folder
A component folder holds the JavaScript class, the HTML template, the CSS file if you need one, and componentName.js-meta.xml.
The meta file sets apiVersion to 45.0 or higher, isExposed, and targets. Every component must set an API version before you can save a change. The file has no fqn attribute.
Example
text
sf org login web --alias dev --set-default