Like learning a musical instrument, programming requires daily practice.
There are some tools that will help you to write code. One of these, Prettier, formats your code, making it easier for you and others to read.
Prettier - Code formatter
editor format
editor.formatOnSave
and editor.formatOnPaste
to true