Terminal commands in macOS allow you to customize the Dock to a considerable extent. Either through commands or third party apps, you can customize the dock so that it has blank spaces between groups of app icons, add dividers to it, change the color, and more. Of course, when all is said and done, you might want to know if what you’ve done to your Dock is permanent. At some point, you might want to go back to the way the Dock looked originally simply because you’re tired of the new look you gave it. It’s going to be up to you to remember exactly what changes you made to the Dock so you can run the command to or the app needed to undo them. A much simpler solution is to just reset the Dock with a terminal command. Here’s how.
Open Terminal and run the following command to reset the Dock;
defaults delete com.apple.dock; killall Dock
This will reset the Dock to how it was when macOS was run for the first time. Any and all apps that you had added to the Dock will be removed as will any and all themes, colors, spaces, dividers, or anything similar. None of your apps will be uninstalled. The command will quit and restart Dock.
Resetting not only removes any and all modifications you made to the Dock but it also adds the default apps back to the Dock in the exact order they were added by the OS. You will have a clean slate to start with and can remove apps, add the ones you need to use frequently, or start customizing it all over again.
If you’re having trouble launching apps from the Dock, this may not necessarily solve the problem. You can still give it a go though. An app that fails to launch from the Dock but launches perfectly from Launchpad might be fixed simply by removing and adding it to the Dock again. A Dock reset is a drastic measure but it might help in this case. If you have apps that fail to launch regardless of how/where you launch them from, it’s probably not the Dock at fault and more likely the app that’s the problem.