//Solution 1:
Select VS Code -> View -> Command Palette,
type: Format Document With...
//For Java:
choose "Language Support for Java by Redhat(default)".
//For other languages:
Then Configure Default Formatter... and then choose Prettier - Code formatter.
//Solution 2:
File > Preferences > Settings > Search for "default formatter"
Default Formatter -> esbenp.prettier-vscode