IntelliJ IDEA keyboard shortcut
Press Ctrl + Alt + L to reformat code.
Practice this shortcut All IntelliJ IDEA shortcuts