Unlike Aura you can't create LWC component from Developer console. So you need a IDE for this and VsCode is the best choice as it is free and fast.
- Open Visual Studio Code.
- Press Command + Shift + P on macOS or Ctrl + Shift + P on Windows or Linux, then type create project. Select SFDX: Create Project with manifest **, and press **Enter.
- Then Select standard project :
- Then enter your prefered name for project or leave blank and hit Enter.
By Using Command Pallete :
- In Visual Studio Code, press Command + Shift + P on macOS or Ctrl + Shift + P on Windows or Linux.
- Type sfdx ** and select **Create Lightning Web Component and enter the name you want to give to your lightning web component and hit Enter twice.
- This will creates the needed files for your first Lightning web component.
By Using Command in terminal:
- In Visual Studio Code, Press Command + Shift + P on macOS or Ctrl + Shift + P on Windows or Linux, then type focus terminal. Press Enter.
sfdx force:lightning:component:create -n myFirstWebComponent -d force-app/main/default/lwc --type lwc, and confirm with Enter. Note : In above command "myFirstWebComponent" is the lwc component name and "force-app/main/default/lwc" is the location for lwc component.
You will get "SFDX: Deploy Source to Org successfully ran" message if it deployed successfully , That's all you have you to do to create LWC component.