There are tools to beautify and deobfuscate the code automatically.

Beautify

When the code is minified into single line JavaScirpt code, we need to Beautify it using tools such as Browser Dev Tools.

Go to Browser Dev Tools Dbugger and click on { } button at the bottom to Pretty Print the script.

We can also use online tools like Prettier or Beautifier..

Deobfuscate

We can use online tools such as UnPacker.

Reverse Engineering

If the code was obfuscated using a custom obfuscation tool then we would need reverse engineering skill to understand how the code is obfuscated.